| 163 | } |
| 164 | |
| 165 | editor::XMLFeature ChangesetWrapper::GetMatchingNodeFeatureFromOSM(m2::PointD const & center) |
| 166 | { |
| 167 | // Match with OSM node. |
| 168 | ms::LatLon const ll = mercator::ToLatLon(center); |
| 169 | pugi::xml_document doc; |
| 170 | // Throws! |
| 171 | LoadXmlFromOSM(ll, doc); |
| 172 | |
| 173 | pugi::xml_node const bestNode = matcher::GetBestOsmNode(doc, ll); |
| 174 | if (bestNode.empty()) |
| 175 | { |
| 176 | MYTHROW(OsmObjectWasDeletedException, |
| 177 | ("OSM does not have any nodes at the coordinates", ll, ", server has returned:", doc)); |
| 178 | } |
| 179 | |
| 180 | if (!OsmFeatureHasTags(bestNode)) |
| 181 | { |
| 182 | std::ostringstream sstr; |
| 183 | bestNode.print(sstr); |
| 184 | auto const strNode = sstr.str(); |
| 185 | LOG(LDEBUG, ("Node has no tags", strNode)); |
| 186 | MYTHROW(EmptyFeatureException, ("Node has no tags", strNode)); |
| 187 | } |
| 188 | |
| 189 | return {bestNode}; |
| 190 | } |
| 191 | |
| 192 | editor::XMLFeature ChangesetWrapper::GetMatchingAreaFeatureFromOSM(std::vector<m2::PointD> const & geometry) |
| 193 | { |
no test coverage detected