Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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"}]

(* Works with Google map API version 3 *)
geoCoder[address_] := Module[{getGeo, geo, cod = 0, i = 0, link}, 
    link = cleanString@address;
    link = "" <>link;
    Import[link, {"JSON", "Data", "results", 1, "geometry", "location"}]];   

Testing it with:

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

you get the right coordinates:


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

Your Answer


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.