Why not ask your question on the new OpenStreetMap Community Forum?

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

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 ♦

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


permanent link

answered 10 May '21, 09:53

H_mlet's gravatar image

accept rate: 13%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

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:


question asked: 10 May '21, 04:32

question was seen: 2,335 times

last updated: 10 May '21, 09:53

powered by OSQA