Downloads and store Geonames.org data locally (MongoDB, Mongoid). Making every Geoname API operation possible on your servers. No hit limit, fast as possible.
Install where you want to populate the DB:
gem install geonames_local
You will also need in your system:
Create a config yml file:
Will generate a "geonames.yml" file on your folder. The file is self explanatory.
Geonames splits the nations/countries database from the rest, so:
To populate the nations database for the first time use:
geonames -c geoconfig.yml nations
Then you can run geonames to populate regions/cities...
geonames -c geonames.yml
To run it. Use -v for verbose.
If you are not sure your country/nation code, use:
geonames list <search>
So, supposing Mongoid, something like this is possible:
City.first.province.country.abbr => "BR"
TBD (by someone else) Be sure to use a database based on the PostGIS template.
- IP Geonames? http://ipinfodb.com