yaph / geonamescache

geonamescache - a Python library for quick access to a subset of GeoNames data.
https://pypi.org/project/geonamescache/
MIT License
99 stars 38 forks source link

Include US state in cities data #19

Closed genmon closed 5 years ago

genmon commented 5 years ago

I maintain my own private fork of geonamescache that, for cities, additionally extracts and includes the admin1code field. For US cities this corresponds to the state code, e.g. FL.

My use case is that I use this module to provide basic city-level geocoding to the users of a service I run, and US-based users seem to require the state code as part of the city name.

Is there a better way of achieving this mapping with the stock module? I may have missed something.

If not, is this the kind of contribution that would be welcome upstream?

yaph commented 5 years ago

Having the admin1code in the cities.json file looks like a useful change to me. I checked your fork and didn't find any missing admin1code values. A pull request is welcome.

genmon commented 5 years ago

Great. I've made a PR #21

genmon commented 5 years ago

Merged in 20e215c55b991b1122e9eef81b95012e79c9a4d9

Thank you!