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

Given Lat/Lng get polygon

0

Is there a way to know a specific point in which region it exists and get the polygon for that region?

I am interested in knowing the Region name and boundaries.

Preferably i would like something to use in a console application.

asked 15 Sep '14, 09:35

jyparask's gravatar image

jyparask
16224
accept rate: 0%

edited 15 Sep '14, 09:36

1

You added the Overpass API tag but it sounds like you want to perform a reverse geocoding query using Nominatim instead? A second query will be necessary for retrieving the polygon of the area returned by Nominatim.

(15 Sep '14, 11:02) scai ♦

@scai I am more than new in this thing, so you may be correct. I really do not know what my options are though :-) . I will check out this link. Thanks.

(15 Sep '14, 11:09) jyparask

One Answer:

1

Thanks to @scai and a bit of reading on the documentation he provided, i found out the actual solution.

Having lat and lng i am doing a reverse call on nominatim reverse providing lat and lon as parameters. Then i do a second call on nominatim search providing country and county from the previous result. This will give me the polygon if request it.

Since i use json, i add polygon_geojson=1 in the query string.

answered 15 Sep '14, 12:02

jyparask's gravatar image

jyparask
16224
accept rate: 0%

(22 Sep '14, 18:52) stephan75