Closed kssomabes closed 4 years ago
I use the data from the GeoNames project without making changes to it. For country names I added support for some common variants using the mapper feature. For cities a mapping of different spellings would get too large to maintain and probably lead to ambiguities. To answer you question, it is possible but I will not add it, sorry.
It's already included in the Geonames but I agree that this might complicate things and cause ambiguities later on. Thanks for addressing my issue! :smile:
I didn't realize that the raw data includes alternative city names. I think including them in the cities.json could be useful.
alternatenames
attribute to entries in cities.json with a list of alternate city names.search_cities
function which returns a list of entries that include the name in alt_names.I just released version 1.2.0. Now you can search the cities data. The test file tests/test_geonamescache.py
uses Kiev as an example. If the search result contains more than one record, the user of the library has to decide which one to choose.
In cities_by_name(), if the city name is Kiev, it would return an empty list but if the city name is Kyiv, it would return a list containing the city in Ukraine. Although both names pertain to the same city.
Would such enhancement be possible?