Reputation: 369
I am using openstreetmap webservices to get longitude and latitude from cities and the opposite What I want to add is a simple select button of countries and cities to the wweb user so I can send my request like this:
http://nominatim.openstreetmap.org/search?country=xxxxx&country=yy&format=xml&accept-language=en-GB
in which "xxxxx" and "yy" is the country and the city selected by the user . The problem is that I did not find a request that will give me all the cities of the country xxxx at the same time from OSM, so I can minimize the request sent to the OSM service and parse the response to display all the cities and their data. So is there a request to make OSM give me all cities or I need to define them in my database or in a script file?
Upvotes: 3
Views: 972
Reputation: 21509
That's not really a typical task for a geocoder (which Nominatim is).
You could obtain this information out of OSM's raw data or via the Overpass API. But there is no straightforward way for this because in order to know which city belongs to which country you will have to do some post-processing of the data.
I think the best would be to find a database already holding the information you are looking for. Try asking on GIS.
Upvotes: 0