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

Method CreateChangeSet

libs/editor/server_api.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41ServerApi06::ServerApi06(OsmOAuth const & auth) : m_auth(auth) {}
42
43uint64_t ServerApi06::CreateChangeSet(KeyValueTags const & kvTags) const
44{
45 if (!m_auth.IsAuthorized())
46 MYTHROW(NotAuthorized, ("Not authorized."));
47
48 OsmOAuth::Response const response = m_auth.Request("/changeset/create", "PUT", KeyValueTagsToXML(kvTags));
49 if (response.first != OsmOAuth::HTTP::OK)
50 MYTHROW(CreateChangeSetHasFailed, ("CreateChangeSet request has failed:", response));
51
52 uint64_t id;
53 if (!strings::to_uint64(response.second, id))
54 MYTHROW(CantParseServerResponse, ("Can't parse changeset ID from server response."));
55 return id;
56}
57
58uint64_t ServerApi06::CreateElement(editor::XMLFeature const & element) const
59{

Callers 4

CreateMethod · 0.80
ModifyMethod · 0.80
DeleteMethod · 0.80
UNIT_TESTFunction · 0.80

Calls 4

KeyValueTagsToXMLFunction · 0.85
to_uint64Function · 0.85
IsAuthorizedMethod · 0.80
RequestMethod · 0.80

Tested by 1

UNIT_TESTFunction · 0.64