petewarden / dstk

A collection of the best open data sets and open-source tools for data science
http://www.datasciencetoolkit.org/
1.12k stars 186 forks source link

Missing countries in Google-style Geocoder #27

Closed samuelleach closed 3 years ago

samuelleach commented 11 years ago

I've being using the DSTK for offline bulk geocoding. I notice that if you want to geocode by the country name alone, then there are a few missing countries. These are the countries I have found so far to be missing:

Bosnia, Brunei, Cote d'Ivoire, Slovakia, Syrian Arab Republic, United Kingdom, Vietnam

eg, API call:

http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false%20&address=Vietnam

petewarden commented 11 years ago

Thanks! I just checked in a fix for those specific countries, and I'd love to hear about any more you run into!

To apply the patch on a running VM, you'll need to grab the latest DSTKData repo (specifically the countrynames.csv and countrypositions.csv files) and run the populate_database.rb script in the main DSTK folder. This will take an hour or two to run by default, but in this case you can comment out all of the calls at the bottom of the script except for load_countries() to speed things up a lot, eg:

load_cities(conn)

load_countries(conn)

load_regions(conn)

load_postal_codes(conn)

Then you can just touch tmp/restart.txt to restart the server code, and you should be set! Email me on pete@petewarden.com if you hit any snags.

samuelleach commented 11 years ago

Okay, the country Macao is missing - this is another spelling for Macau (which works) (http://en.wikipedia.org/wiki/Macau)

petewarden commented 11 years ago

Thanks! Should now be added and accessible at http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false&address=Macao