Forum: Ruby on Rails geocoding addresses with ym4r google maps

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
86fbe1d13676473496f4b39421466f7c?d=identicon&s=25 Scott Pn (darkomen1234)
on 2007-07-24 05:10
Does anyone know how to geocode addresses using the YM4R Google Map
plug-in?
86fbe1d13676473496f4b39421466f7c?d=identicon&s=25 Scott Pn (darkomen1234)
on 2007-07-25 04:08
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
F48118fe74b0c7f6fd82a0ee422fa34e?d=identicon&s=25 snacktime (Guest)
on 2007-07-26 00:46
(Received via mailing list)
On 7/23/07, Scott Pn <rails-mailing-list@andreas-s.net> 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
86fbe1d13676473496f4b39421466f7c?d=identicon&s=25 Scott Pn (darkomen1234)
on 2007-07-26 05:11
snacktime wrote:
> On 7/23/07, Scott Pn <rails-mailing-list@andreas-s.net> 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

Yeah 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 :(
This topic is locked and can not be replied to.