Is it possible to get all cities of a country from OSM using a web service? I need this in order to use in a combo box (fill the combo box with city names when user selects a country) Thanks in advance. asked 05 May '12, 10:02 sewdil |
No. OpenStreetMap has the raw data from which you could extract such a list yourself, but there's no ready-made web service that does that for you. It is possible to go a little way in your direction with the Overpass API; this allows you to ask for "all objects tagged Say you wanted to find all cities in Moldova. Google can be used to find out that the relation id you are looking for is 58974. Add 3600000000 to that number and use the following Overpass query:
This returns the OSM XML for all city nodes in Moldova. However, requesting such information live from the database every time you need it is a terrible waste of time; you really want to compute such a list ahead of time and then use that. answered 05 May '12, 11:17 Frederik Ramm ♦ |