block by mpmckenna8 10899328

Geonames cities to mongoDB thing

#Generate cities data

  1. wget http://download.geonames.org/export/dump/cities15000.zip
  2. unzip cities15000.zip
  3. node geonames.js cities15000.txt

The result is json array of cities in the following format:

{
    _id: <ID>
    name: <Name>,
    alternate_names: [<alternatename1>,…],
    coordinates: [<Latitude>, <Longitude>]
}

#Import to MongoDB

mongoimport -d db_name -c cities cities.json --jsonArray

geonames.js