How to get ALWAYS a city from GPS coordinates?
Hello, I have a GPS coordinates list and I want to retrieve the corrisponding cities.
I'm making calls to Nominatim service, like this: https://nominatim.openstreetmap.org/reverse?format=json&lat=30.4573699&lon=-97.8247654
The response in this case is:
```
{"place_id":"32590342","licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"node","osm_id":"2785042716","lat":"30.4573699","lon":"-97.8247654","display_name":"Nagoya Steak & Sushi, 11630, RM 620, Anderson Mill, Austin, Williamson County, Texas, 78713, USA","address":{"restaurant":"Nagoya Steak & Sushi","house_number":"11630","road":"RM 620","neighbourhood":"Anderson Mill","city":"Austin","county":"Williamson County","state":"Texas","postcode":"78713","country":"USA","country_code":"us"},"boundingbox":["30.4572699","30.4574699","-97.8248654","-97.8246654"]}
```
So I can just get the value of `city` property and obtain the city.
What about getting the city when the response doesn't have `city` property?
According to [this answer][1], I see that I can get other properties, such as `town`, `village`, `suburb`, `locality`, `hamlet` and so on... but what is the best? If Nominatim response doesn't have `city` what property should I look for? And if even that property doesn't appear what should be the next property to try to get the value from?
Can you make a list of these properties, ordered by frequency or relevance?
In addition, what about places that doesn't have any address property? Here is some examples:
http://nominatim.openstreetmap.org/reverse?format=json&lat=19.2954697&lon=-99.1545323
http://nominatim.openstreetmap.org/reverse?format=json&lat=28.7146224&lon=77.1577398
http://nominatim.openstreetmap.org/reverse?format=json&lat=33.2038405&lon=-96.7436876
http://nominatim.openstreetmap.org/reverse?format=json&lat=28.7131567&lon=77.1466021
http://nominatim.openstreetmap.org/reverse?format=json&lat=32.2327348&lon=-81.4502764
http://nominatim.openstreetmap.org/reverse?format=json&lat=35.851869&lon=-79.0196451
http://nominatim.openstreetmap.org/reverse?format=json&lat=19.3709484&lon=-99.1666932
http://nominatim.openstreetmap.org/reverse?format=json&lat=30.3926127&lon=-86.4258786
http://nominatim.openstreetmap.org/reverse?format=json&lat=54.5786988&lon=-128.6473328
http://nominatim.openstreetmap.org/reverse?format=json&lat=33.0545235&lon=-97.2312726
http://nominatim.openstreetmap.org/reverse?format=json&lat=20.2117278&lon=-87.4640324
http://nominatim.openstreetmap.org/reverse?format=json&lat=37.9219071&lon=23.7409803
http://nominatim.openstreetmap.org/reverse?format=json&lat=18.2083196&lon=-66.8965797
How to deal with them?
Generally speaking, what is the best strategy to ALWAYS get a city from GPS coordinates?
``````
[1]: https://help.openstreetmap.org/questions/61683/all-possible-fields-of-address-object