Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have got an Excel spreadsheet with roundabout 15,000 locations, which are only identified by the towns or villages name and the country. I am intending to present these on a world map.

Therefore, I need to know, whether there is a tool, which can find the coordinates for me based on the location's name.

Pasting every name into google maps is no solution due to the high number of locations.

Thank you for your help and I wish you a satisfying Christmas!!

share|improve this question
add comment

5 Answers 5

The GeoNames API would be a good place to start if you are able to write a script to pull the data for you. There is a nice example, written in Python, in this github project.

You can also download the GeoNames data set here. Natural Earth also provides a data download.

share|improve this answer
1  
The only issue that would be left is disambiguation - try searching for Washington in the USA and see how many hits you get. –  iant Dec 24 '12 at 8:45
add comment
up vote 4 down vote accepted

I decided to develop a python script using the Nominatim tool by Open Streetmap to find the coordinates of the locations and it is working pretty good.

I made a screenshot, because for some reason, I am not able to add the code here:

enter image description here

There are some things you should not forget, when using this script:

  • According to the rules of Nominatim you should have a 1 second time out between every request (included in the script)
  • Add your mail adress in the request, thus you can be contacted as soon as problems appear
  • You will need to create an infile and an outfile .txt file and fix the paths in the script
  • The infile should be formatted in "UTF-8 no BOM" (you can use editors like notepad++ for this)

A friend developed the script for me, therefore I am not able to answer you that much questions about it. Nevertheless, if there is a question, I will do my best and also ask him.

share|improve this answer
add comment

There are a lot of options here. While GeoNames is a good option, and you may be able to use the google maps API (depends on your legal needs - read the small print to know how the google terms apply to your particular circumstance), you also may be able to use one of the OSM options:

Again, for 15k locations, please consider the terms of use for public servers.

share|improve this answer
add comment

Or if you've knowledge of the R language Here is one of many examples using the rjson package and the google maps api:

require(rjson) # load rjson package
getCoordinates <- function(address) {
url <- paste("http://maps.google.com/maps/geo?q=",address,"&output=json",sep="")
map_data <- fromJSON(paste(readLines(url),collapse=""))
coord <- map_data$Placemark[[1]]$Point$coordinates[1:2]
return(coord)
}

# example query
address <- paste(data$zip[1],"+",data$city[1],"+",data$state[1],sep="")
getCoordinates(address)
share|improve this answer
add comment

While there are many good geocoders out there, most require a bit familiarity and alot of patience with programming and other computer wizardry. But I think for this specific user (indeed the average computer user) a more ideal solution would be the "Easy Georeferencer" software that I created this summer (that is, I'm the author of this program). I created it precisely to be user-friendly for people who, like the original poster here, do not have much or any programming background.

You simply download the program and double-click it, and a simple GUI will guide through the rest, no installation required. It would literally take you one minute to point the program to your data and specify which fields contain the country/village names, and then you can relax for 10-20 minutes while the program geocodes your data. All happens offline, so no need to worry about timeouts or webgeocoding limits.

You can download it for free from its official website:

http://geocodeanything.wordpress.com/

And here's a screenshot:

enter image description here

Hope it's useful :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.