Skip to content
Geonames Data -> Local MongoDB
Find file
Latest commit c4d5e15 @nofxx v3.3.5
Failed to load latest commit information.
bin clean up and fixes
lib v3.3.5
spec some fixes
task rubocop duty
.gitignore gitignore
Gemfile clean up
Guardfile rubocop duty
MIT-LICENSE working again... mongodb fix integer ids
Rakefile fix rakefile
geonames.yml need serious rewrite
geonames_local.gemspec clean up

Geonames Local

Downloads and store data locally (MongoDB, Mongoid). Making every Geoname API operation possible on your servers. No hit limit, fast as possible.

  • Download all country data
  • Merges ZIP into cities, so you have masks
  • Updates using geonames IDs, no duplication


Install where you want to populate the DB:

gem install geonames_local

You will also need in your system:

  • unzip
  • curl


Create a config yml file:

geonames init

Will generate a geonames.yml file on your folder. The file is self explanatory.

Geonames splits the nations/countries database from the rest, so: It'll also populate the nations collection automatically: 252 nations.

geonames -c geonames.yml

To run it. Use -v for verbose.

If you are not sure your country/nation code, use:

geonames list <search>


Using models:

City.first.region.nation.abbr => "BR"


Something went wrong with that request. Please try again.