Hi, I am trying to get city name from reverse geocoding. Problem is for some geo location it is showing city name but for some it is other details like county, suburb. It is hard for me to use the data as it is changing place to place. Here is the example. If you check the output of above links then you can see the difference. Is there any way I can get the Country Name, Zip code, and City name properly. Thanks asked 02 May '18, 21:04 Raja07848 |
That's not possible with Nominatim. The hierarchies in different countries sometimes skip a level (think small countries that don't have states), some countries don't have postal code systems, there's villages without cities (administered by a county instead), etc. On top the underlying OpenStreetMap data might simply be lacking information, or links between places (if the boundary of a city isn't known then it's more or less guessing if a nearby village belongs to the city or not). Your best chance is to treat postal codes as optional. And if a city is not returned choose the country/state/district or even country. answered 03 May '18, 12:59 mtmail |
The example in Denmark isn't in a city, so I think you can't expect a city name there at least.