How to find all (zip code, city name) pair through OpenStreetMap?

5.2k views Asked by At

I want to find all zip code and its corresponding city name, country name in Europe.

My initial idea is to query osm data which contains tag like:

<tag k="addr:city" v="München"/>
<tag k="addr:country" v="DE"/>
<tag k="addr:housenumber" v="10"/>
<tag k="addr:postcode" v="80538"/>

The result should be a dictionary which key is the zip code and value is a tuple composed of city and country name.

How could I query the OSM, for example through http://overpass-turbo.eu/ to get the raw information? Is there any better way?

1

There are 1 answers

0
MaM On BEST ANSWER

That kind of data structure you are looking for is the basis for every so called 'geocoder' as nominatim. I recommend to look over there: https://wiki.openstreetmap.org/wiki/Nominatim
https://wiki.openstreetmap.org/wiki/Nominatim/Development_overview