This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Difference between /map vs /interpreter queries

0

We were previously using http://overpass-api.de/api/map?bbox={bounding box cords} to retrieve data within the provided bounding box coords. To increase our limits and speed we have launched our own instance of the overpass API.

This API uses the interpreter and we are making the query like /api/interpreter?data=[out:xml];node({bbox coords});out;

This produces different results and we do not get street data like tag k="highway" v="secondary" or tag k="type" v="multipolygon" for buildings.

What is the different between /api/map vs /api/interpreter and is it possible to get similar data with the interpreter? What would be the equivalent api/map?bbox={bounding box cords} query for the interpreter?

asked 19 Dec '19, 18:55

kida001's gravatar image

kida001
31346
accept rate: 0%

edited 20 Dec '19, 10:08

scai's gravatar image

scai ♦
33.3k21309459


One Answer:

1

The reason you aren't receiving elements with tags highway=secondary or multipolygon elements is that you are only querying for nodes. To retrieve roads and buildings you need to search for ways, to retrieve multipolygon buildings you need to search for relations, too.

To search for nodes, ways and relations (nrw) use the following query:

https://.../api/interpreter?data=[out:xml];nwr({{bbox}});out;

answered 20 Dec '19, 10:15

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

edited 20 Dec '19, 10:15

Thank you, before your answer I was using [out:xml];(way[highway]({{bbox}});way[building](#{{bbox}}););(._;>;);out;

Is either one of the two more efficient? At times if I just want to search for buildings is it best to use the query I have above sans highway?

(20 Dec '19, 18:00) kida001

I'm not really familiar with Overpass API internals. However personally I would always stick to the more stricter rules as long as it returns all necessary data.

(21 Dec '19, 18:47) scai ♦

Source code available on GitHub .