Hello, I'm here from a project where we need structured geodata. For this, I found the Overpass API, which seems to do exactly what we need. The Reason for this is that OpenGeoDB is currently offline, and we want to cover a wider area than what we currently have. We basically need the name, zip code and coordinates of all cities, towns and villages of a country. So very similar to what OpenGeoDB offered. Unfortunately I'm not that into the complex topic of OSM data and the Overpass API and I think you guys here know a lot better about it :) Can you help me to build an Overpass API query that can provide this data? With kind regards Lena asked 26 Nov '21, 09:52 Feuerhamster |
Trying to do this with the publicly available Overpass API is going to be a painful road paved with lots of timeouts. (Painful for you and the server.) So don't do it. Instead, take the OpenStreetMap data for your country of interest (eg from download.geofabrik.de) and then either filter out the "place nodes" with a tool like Zip codes is going to be a problem, they will only be available for very few countries and they are not usually linked directly to a place (since the same place can have 1, 10, or 100 zip codes). If the country you are looking at has good coverage of post code polygons then you can use the database approach to find out which post code polygon a place is in. If not, you can sometimes at least "guess" by looking at some individual addresses near the centre of the place. Do not assume that you can simply get from OSM what you previously got from OpenGeoDB without spending a few days on it. As far as I know, OpenGeoDB also has a hierarchy that lets you see which city is in which county is in which state and so on, something that you will have to compute yourself when working with OSM. answered 26 Nov '21, 10:21 Frederik Ramm ♦ |
Sorry not to answer you question, but you might want to look at wikidata instead of OSM for this kind of queries. answered 26 Nov '21, 14:54 H_mlet |