Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am writing a research proposal for a project on voter turnout as related to proximity to mass transit. The first part of my project would require geocoding hundreds of thousands of addresses, but I'd rather not have my laptop running ArcGIS for days on end to do it. My school's supercomputer does not have GIS software but it does have Mathematica Version 8. Is there a way to geocode addresses in Mathematica? I've found several workaround solutions online, but nothing that I think would get the approval of the campus IT office.

share|improve this question
    
That data should exists already, try contacting local government or buy it from some map company like google maps –  ssch Feb 4 '13 at 21:51
2  
You can use Mathematica to implement any Web-based method described on the GIS site. For instance, about 20 months ago I searched that site for solutions and implemented two of them in MMA--Google Maps and Yahoo Maps. These are contractually limited to a few thousand per day (which was good enough for me), but there are others with fewer limitations. The GIS community can also provide advice on commercial solutions. –  whuber Feb 4 '13 at 22:44
add comment

1 Answer

This is a very simple geocoder that I wrote some time ago.

cleanString[string_] := Module[{l1,l2},
    l1 = Characters@"ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿ";
    l2 = Characters@"SZszYAAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyy";
    StringReplace[string, Thread[l1 -> l2]~Join~{" " -> "%20", "," -> "%2C"}]
]

geoCoder[address_] := Module[{getGeo, geo, cod = 0, i = 0, link}, 
    link = cleanString@address;
    link = "http://maps.google.com/maps/geo?q=" <> link <> "&output=csv";
    StringSplit[Import[link],","]
]     

Testing it with:

geoCoder["Av Paulista, 510, Sao Paulo, Brasil"]

you get the right coordinates:

{"200", "8", "-23.5680096", "-46.6482837"}

Here is the Google Documentation about request limits. The free one has a limit of 2.500 requests per day.

share|improve this answer
    
You can try other geocoding API: 7 Free Geocoding APIs: Google, Bing, Yahoo and MapQuest, APIs are very similar –  Tuku Feb 5 '13 at 15:51
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.