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

How to get id of all cities (provinces) in a country ?

0

Well normally, I need to search on the internet for all cities, provinces within a country.

Then I search for that name on our site (openstreetmap), after that I click for suggestion to find the ID.

My far purpose is to get Polygon of that region, from the ID by using this link: http://polygons.openstreetmap.fr/get_geojson.py?id=1903516

But I have a difficult time finding all ID.

Is there any api to get ID of all cities (provinces) within a country, or districts within a city ? or a site that can do so ?

asked 10 May '21, 04:32

LoiChau's gravatar image

LoiChau
11112
accept rate: 0%

Looks like this ID is just the relation ID of the administrative boundary: https://www.openstreetmap.org/relation/1903516

(10 May '21, 08:22) scai ♦

One Answer:

0

Have a look at Overpass QL, some examples might even fit your bill.

Regards

answered 10 May '21, 09:53

H_mlet's gravatar image

H_mlet
5.4k1781
accept rate: 13%