Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using geonames service locally

I was planning to use geonames API but actually it seems far more sensible to use the geonames locally and not use their web API. So my question is, does anyone know how to interface with the geonames data locally?

Do I need to manually import it into a database and then reference it like a normal DB?

like image 217
Jimmy Avatar asked May 29 '13 13:05

Jimmy


People also ask

Is GeoNames free?

free : GeoNames data is free, the data is available without costs. cc-by licence (creative commons attributions license).

What are GeoNames for?

GeoNames is integrating geographical data such as names of places in various languages, elevation, population and others from various sources. All lat/long coordinates are in WGS84 (World Geodetic System 1984). Users may manually edit, correct and add new names using a user friendly wiki interface.

Are GeoNames reliable?

GeoNames is one of the largest and most often used gazetteer and it is generally assumed to be of sufficient quality.


1 Answers

Yes you will have to import the database manually if you want to query the database locally.

1 - If you plan to use MySQL you can follow the explanations from this post Importing data from geonames.org database into MySQL DB

2 - If the table structure is not up to date you can also refer to the GeoNames forum: http://forum.geonames.org/gforum/posts/list/732.page

3 - Once you have created your tables following the given structure you can use LOAD DATA INFILE or LOAD DATA LOCAL INFILE to bulk import the data from the CSV files.

4 - The importation of the allcountries table can take more than 10 minutes locally. It might be better to create your indexes before you import the data.

(A shell Script is also available if you are familiar with the command)

like image 95
RafaSashi Avatar answered Oct 05 '22 23:10

RafaSashi