Geocoding Addresses with Ruby and Google Maps:
One of my new found interests has to be Ruby. A neat language that borrows ideas both from Perl and Python (one of my favourite languages). As a result, I decided to hack out a little script that takes an argumet from the command line as an address and spits out the latitude and longitude. This is done by sending the query to Google Maps url which then returns an XML embedded in Javascript ( I don't know why Google does this). You can then parse out the points within the XML. The accuracy from my experience is also very decent. Anyways, enough talk. Here's the link to the code.
Code Example:
One of my new found interests has to be Ruby. A neat language that borrows ideas both from Perl and Python (one of my favourite languages). As a result, I decided to hack out a little script that takes an argumet from the command line as an address and spits out the latitude and longitude. This is done by sending the query to Google Maps url which then returns an XML embedded in Javascript ( I don't know why Google does this). You can then parse out the points within the XML. The accuracy from my experience is also very decent. Anyways, enough talk. Here's the link to the code.
Code Example:
fazer@laptop$ ruby latlong.rb '140 allstate parkway markham on'
43.855359 -79.368847
Comments