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

Download all countries with regions and cities

0

Hello, I would like to know, what is the best way to download all countries from around the world. Each country should have related regions and regions should have cities (cities with latitude and longitude). It seems to be impossible to do it using overpass turbo (too much data). Thanks for your answers.

asked 06 Mar '20, 09:43

avenh2's gravatar image

avenh2
11112
accept rate: 0%

1

Do you just want country boundaries and cities, or do you want more map data? Not all countries structure their internal divisions the same way.

(07 Mar '20, 13:29) InsertUser

I need country, region, city names. Cities should have gps coordinates.

(09 Mar '20, 05:56) avenh2

One Answer:

0

For countries and regions, the best source I know of is https://wambachers-osm.website/boundaries/. It’s a third party service (run by a volunteer) which offers preprocessed administrative boundaries per country and their subdivisions.

For cities one source is the Geofabrik Download service. For each country/region it offers a zip file with preprocessed layers in ESRI Shape format – look for the .shp.zip downloads. Inside you will find files gis_osm_places_free_1.* which contain points with “places”. These can be everything from cities, suburbs, towns, down to villages, hamlets and farms. So depending on your definition of “city” you may want to filter them.

If you combine these two sources, cities will not be directly connected to countries, but you should be able to link them by performing a point-in-polygon test.

answered 11 Mar '20, 21:51

hfs's gravatar image

hfs
85151525
accept rate: 17%

Source code available on GitHub .