The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Geocoding Goodness

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Hodel

Posts: 660
Nickname: drbrain
Registered: Mar, 2006

Eric Hodel is a long-time Rubyist and co-founder of Seattle.rb.
Geocoding Goodness Posted: Jun 13, 2006 3:41 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eric Hodel.
Original Post: Geocoding Goodness
Feed Title: Segment7
Feed URL: http://blog.segment7.net/articles.rss
Feed Description: Posts about and around Ruby, MetaRuby, ruby2c, ZenTest and work at The Robot Co-op.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eric Hodel
Latest Posts From Segment7

Advertisement

I’ve implemented ruby bindings for the three major geocoding APIs as gems:

APIgem name
Yahoo!yahoo-geocode
Googlegoogle-geocode
geocoder.usgeocoder-us

And as a bonus, you get a Yahoo! search gem to search either the web or for locations, yahoo-search.

The bindings all have similar APIs, but return different objects depending upon what information the API reliably provides. Yahoo! gives the most information, followed by Google, followed by geocoder.us.

Yahoo!

documentation

require 'rubygems'
require 'yahoo/geocode'

yg = Yahoo::Geocode.new application_id
locations = yg.locate '701 First Street, Sunnyvale, CA'
p location.first.coordinates

(and searching for locations)

documentation

require 'rubygems'
require 'yahoo/local_search'

yls = Yahoo::LocalSearch.new application_id
results, = yls.locate 'pizza', 94306, 2
results.each do |location|
  puts "#{location.title} at #{location.address}, #{location.city}" 
end

Google

documentation

require 'rubygems'
require 'google_geocode'

gg = GoogleGeocode.new application_id
location = gg.locate '1600 Amphitheater Pkwy, Mountain View, CA'
p location.coordinates

geocoder.us

documentation

require 'rubygems'
require 'geocoder_us'

gu = GeocoderUs.new 'username', 'password'
p gu.locate('1924 E Denny Way, Seattle, WA')

Read: Geocoding Goodness

Topic: rcov 0.6.0: "differential code coverage", full (faster) cross-referenced reports, vim integration Previous Topic   Next Topic Topic: Registered for RailsDay 2006

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use