Search code examples
xmlmappingopenstreetmapoverpass-api

How do I deal with OpenStreetMap Overpass API XML containing references to non-present nodes?


I'm using the Overpass API to query a bounding box:

http://overpass-api.de/api/interpreter?data=node(44.8108,-0.638973,44.9167,44.8108);out;way(44.8108,-0.638973,44.9167,44.8108);out;

which is supposed to return all nodes and routes in the region (44.8108,-0.638973,44.9167,44.8108).

The XML parsing shows that some ways are composed of nodes that are not defined in the XML. For example, way[id=459837502] is composed of node[ref=4557387912], but there is no information (longitude, latitude, ...) about that node in the file.

What kind of query can I use to get a complete map (in terms of data coherence)?


EDIT. even worse: I've got a route (n1, ...., n100) where n1 and n100 are defined in the nodes section but none of the intermediate nodes.

EDIT2. the map size is 150Mbytes


Solution

  • To get ways in a bounding box with all of their respective nodes, you need to use a different syntax:

    ( way(44.8108,-0.638973,44.9167,44.8108); >; );out;