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

Overpass API double admin_level for one coordinate (is_in)

0

Overpass API delivers a result with two "admin_level: 4" entries for one coordinate as shown:

http://overpass-api.de/api/interpreter?data=[out:json];is_in(%2253.166591%22,%229.841431%22);out+body;%3E;out+skel;

This leads to filtering problems. How does that happen?

asked 02 Sep '18, 18:59

jolipo's gravatar image

jolipo
11112
accept rate: 0%


One Answer:

0

The reason the are both returned is that they both exist in the data and are both interpreted as areas by Overpass-API. Which isn't very helpful.

One of the objects represents just the land area:

https://www.openstreetmap.org/relation/454192

I guess you could filter on an additional tag like boundary=administrative (or whatever might be suitable).

answered 02 Sep '18, 19:35

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 02 Sep '18, 19:38

Source code available on GitHub .