Does anyone know how to geocode addresses using the YM4R Google Map plug-in? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 7/23/07, Scott Pn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Does anyone know how to geocode addresses using the YM4R Google Map > plug-in? > --It''s been a while but I know it''s in the docs. Also, google rate limits lookups to around 1 every 2 seconds. If you go over that for any period of time they block your ip. Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Pn wrote:> Does anyone know how to geocode addresses using the YM4R Google Map > plug-in?Nevermind I found out how to do it. require ''net/http'' require ''csv'' require ''xmlrpc/client'' module Geocode def geocode(input) server = XMLRPC::Client.new2(''http://rpc.geocoder.us/service/xmlrpc'') result = server.call2(''geocode'', "#{input}") return { :score => 0 } if result.nil? || result[0].nil? return { :latitude => result[1][0][''lat''], :longitude => result[1][0][''long''], :description => nil, :original_address => input } end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
snacktime wrote:> On 7/23/07, Scott Pn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Does anyone know how to geocode addresses using the YM4R Google Map >> plug-in? >> -- > > It''s been a while but I know it''s in the docs. Also, google rate > limits lookups to around 1 every 2 seconds. If you go over that for > any period of time they block your ip. > > ChrisYeah I realize that, and that is why I am using http://rpc.geocoder.us/service/xmlrpc instead. And for reference to anyone who comes by this thread, I think you can buy more "geocode references" from google and yahoo for a fee :( -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---