NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the 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

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 ♦

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

Regards

permanent link

answered 10 May '21, 09:53

H_mlet's gravatar image

H_mlet
5.4k1781
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

By RSS:

Answers

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:

×535
×55

question asked: 10 May '21, 04:32

question was seen: 2,644 times

last updated: 10 May '21, 09:53

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum