How to get the district/city/municipality given a gps position as well as the corresponding polygon

Hey everyone,

I would like to get the boundary as a geojson file or something similar given the gps info of a point and then extracting the district, city, municipality

So far I found out about nominatim to get data like the municipality now I’m wondering how I get the polygon from this information.

The info I get from nominatim is the following:

{"place_id":100891653,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"way","osm_id":6243831,"lat":"59.385659776299605","lon":"18.30840420631662","class":"highway","type":"residential","place_rank":26,"importance":0.10000009999999993,"addresstype":"road","name":"Karlsuddsvägen","display_name":"Karlsuddsvägen, Karlsudd, Vaxholm, Vaxholms kommun, Stockholm County, 185 33, Sweden","address":{"road":"Karlsuddsvägen","hamlet":"Karlsudd","town":"Vaxholm","municipality":"Vaxholms kommun","county":"Stockholm County","ISO3166-2-lvl4":"SE-AB","postcode":"185 33","country":"Sweden","country_code":"se"},"boundingbox":["59.3833860","59.3878843","18.2967468","18.3278196"]}

using: https://nominatim.openstreetmap.org/reverse?format=json&lat=59.3855&lon=18.3084

Thanks in advance for any further pointers to get the boundaries.

6 posts - 3 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/how-to-get-the-district-city-municipality-given-a-gps-position-as-well-as-the-corresponding-polygon/101972