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

The is_in query does just that. Read all about it here:

http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Query_for_areas_.28is_in.29

permanent link

answered 07 Feb '16, 11:55

maxerickson's gravatar image

maxerickson
11.4k1075161
accept rate: 30%

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:

http://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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×377
×34
×9
×5
×1

question asked: 07 Feb '16, 10:30

question was seen: 2,810 times

last updated: 07 Feb '16, 17:08

powered by OSQA