MCPcopy Create free account
hub / github.com/comaps/comaps / DeleteElement

Method DeleteElement

libs/editor/server_api.cpp:98–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void ServerApi06::DeleteElement(editor::XMLFeature const & element) const
99{
100 std::string const id = element.GetAttribute("id");
101 if (id.empty())
102 MYTHROW(DeletedElementHasNoIdAttribute, ("Please set id attribute for", element));
103
104 OsmOAuth::Response const response =
105 m_auth.Request("/" + element.GetTypeString() + "/" + id, "DELETE", element.ToOSMString());
106 if (response.first != OsmOAuth::HTTP::OK && response.first != OsmOAuth::HTTP::Gone)
107 MYTHROW(ErrorDeletingElement, ("Could not delete an element:", response));
108}
109
110void ServerApi06::UpdateChangeSet(uint64_t changesetId, KeyValueTags const & kvTags) const
111{

Callers 3

DeleteMethod · 0.80
DeleteOSMNodeIfExistsFunction · 0.80
UNIT_TESTFunction · 0.80

Calls 5

GetAttributeMethod · 0.80
RequestMethod · 0.80
GetTypeStringMethod · 0.80
ToOSMStringMethod · 0.80
emptyMethod · 0.45

Tested by 2

DeleteOSMNodeIfExistsFunction · 0.64
UNIT_TESTFunction · 0.64