| 78 | } |
| 79 | |
| 80 | void ForEachRefInWay(pugi::xml_document const & osmResponse, pugi::xml_node const & way, ForEachRefFn const & fn) |
| 81 | { |
| 82 | for (auto const & xNodeRef : way.select_nodes("nd/@ref")) |
| 83 | { |
| 84 | std::string const nodeRef = xNodeRef.attribute().value(); |
| 85 | auto const node = osmResponse.select_node(("osm/node[@id='" + nodeRef + "']").data()).node(); |
| 86 | ASSERT(node, ("OSM response have ref", nodeRef, "but have no node with such id.", osmResponse)); |
| 87 | XMLFeature xmlFt(node); |
| 88 | fn(xmlFt); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void ForEachWayInRelation(pugi::xml_document const & osmResponse, pugi::xml_node const & relation, |
| 93 | ForEachWayFn const & fn) |