cjheath/geoip — pull request #25 by tpena (2013-02-23 01:13:36+00:00)
Title: Added support for mapping the country-iso2 and region codes to a region name

The region stored in the GeoIP data file is not actually a region name as the City attribute would imply, but rather a region code. Together with the country ISO2 code, you can map these values to a region name using the supplied mapping file provided by MaxMind.

http://dev.maxmind.com/static/csv/codes/maxmind/region.csv

The changes in this commit add support to City for a region name, which is currently named "region_mapped_name". Obviously, region_name would be the best fit, but changing it could break existing applications which actually rely on the value being a region-code. Or is this assumption perhaps invalid? Granted, "region_mapped_name" is perhaps not the best name, but I am more than open to suggestions.

The one concern I sort of have, however, is how often this mapping file could change. I looked at the MaxMind Java and Python client libraries and both appear to have these information embedded in the sources (well, the Java library does and the Python library calls into the client libGeoIP.so.1 binary).