Geonames MySQL Data Importer V 2.0

A shell Script to download and import geonames.org dumps into a mysql database.


This project is maintained by CodigoFuerte

Introduction.

The contents of this project are a compendium of different knowledge adquired about GeoNames geographical database. Most of this knowledge was obtained from the GeoNames Forum - Importing *all* geonames tables to MySQL.

The result is a linux shell script that allows you to download the GeoNames data dumps from the official site and create a MySQL database structure in which you can import that dumps.

This V 2.0 has been completely rewritten to be more user friendly including most of the pull requests sent by other contributors. Please, feel free to collaborate in the project if you consider it.

Configuration Issues

As for this new version of Geonames MySQL Data Importer several configuration parameters has been included at the begining of the script.

You can chage this at your own convenience to match your environment.

The parameters included are:

            # Default values for database variables.
            dbhost="localhost"
            dbport=3306
            dbname="geonames"
            dbusername="root"
            dbpassword="root"

            # Default value for download folder
            download_folder="$working_dir/download"

            # Default general dumps to download
            dumps="allCountries.zip alternateNames.zip hierarchy.zip admin1CodesASCII.txt admin2Codes.txt featureCodes_en.txt timeZones.txt countryInfo.txt"

            # Postal Code information.
            # You can specify a set of the files located at http://download.geonames.org/export/zip/
            postal_codes="allCountries.zip"        
        

Operation Modes

The original philosophy of the project has not been changed in this new version. So, two operation modes are provided. These are: