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

How to get info about administrative levels from single coordinate in overpass

0

By providing a single coordinate, not a bounding box, I want to extract the administrative areas that is within the coordinate. For example when providing the coordinate for central London, I would like to know all the boundaries that covers the coordinate, actual country, region, sub region administrative area etc.

Is it possible to get such information from overpass?

What I am asking for is more or less the same informatio that is given by using the questing mark function i open street map where it presents all such information.

I need to know the id of the boundary, the administrative level and the name of the boundary. An I also would like to know the actual boundary as a polygon.

I want to access it by using either php or javascript...

asked 07 Feb '16, 10:30

SunYour's gravatar image

SunYour
16224
accept rate: 0%


One Answer:

1

answered 07 Feb '16, 11:55

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Thanks, that is what I was looking for!

This example is what I need to call http://overpass.osm.rambler.ru/cgi/interpreter?data=[out:json];is_in(59.68,16.77);out;

Now I need to adapt my parser that used the lovely mapIt solution, but it unfortunately lacked som issues here and there.

I still need to find out how to get the boundary polygon, preferrably as kml if possible.

(07 Feb '16, 16:22) SunYour
1

You can use out geom to retrieve the geometry:

https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Print_.28out.29

There is not support for KML output from Overpass API. You can look at Overpass Turbo for an example of converting the output, togpx and tokml here: https://github.com/tyrasd/overpass-turbo/tree/master/libs

(07 Feb '16, 17:08) maxerickson

Source code available on GitHub .