views:

80

answers:

4

there is a limit of 2400 geocoding request for google service. even if each request is cached and not duplicated its possible to exceed this limit if the request is being made from a rails app.

short of purchasing the premium package(which i dont know the cost of), what else can one do?

thanks

+1  A: 

I do all of my geocoding from the application servers using geokit. That allows me a backup of yahoo maps using their multigeocoder. That way - if one fails, the other succeeds. Geokit also provides an identical interface to the two services, so you only need to code to the one abstraction layer. The google limit is per server per day, so if you have multiple app servers you can spread out the load to increase your limit. Yahoo's limits are 5000/server/day.

Hope this helps, good luck!

Geoff Lanotte
http://code.google.com/apis/maps/faq.html#geocoder_limit, here it says 2500
badnaam
wow, not sure when that happened! I updated my post.
Geoff Lanotte
A: 

This is what I did: 1. Try to use the Navigator's Location functionality. 2. If that fails, use Google Gears (I dont think it consumes google limit) 3. If that fails use Google Maps API 4. If that fails (limit exceeded), geolocate based on user IP and maxmind database (free)

The source here may be of some help: gvkalra.appspot.com/reachme

Gaurav Kalra
Navigator's location functionality, can you please explain?
badnaam
@badnaam: please refer here: http://www.w3.org/TR/geolocation-API/
Gaurav Kalra
+1  A: 

I believe that if you geocode on the client side that you won't have any issues with geocoding limits. Calls to google.maps.Geocoder() and the google.loader.ClientLocation() both count against the IP of the client machine rather than your server IP. If you need to some on the server side I would second Geoff's suggestion to use Geokit's multigeocoder.

Mike Williamson
can you point me to some reasource or share details of how to geocodeon the client side? For example, in my rails app I am trynig to geocode posts near a zipcode, how would you do that from the browser?
badnaam
Here is an example. Sorry about the formatting. var geocoder = new google.maps.Geocoder();geocoder.geocode({'address': '123 Spadina St Toronto Canada'}, function(results, status) {if (status == google.maps.GeocoderStatus.OK) { alert(results[0].geometry.location);}})There is more info in the api docs as well: http://code.google.com/apis/maps/documentation/javascript/reference.html#GeocoderI haven't done any reverse geocoding yet but its probably much the same.google.loader.ClientLocation() dosen't work with maps v3 yet (not sure why but I am sure it will soon.
Mike Williamson
You can punch that example code into firebug on a page that has google maps and it should work for you. This might not be what you need if you only have a zip code to work with. In either case that should give you a starting point. Geokit can do stuff like Posts.find(:all, :origin =>[-44.4419, 170.1419], :within=>200) once you have a latlng as a starting point from the client side. Do some reading about the latlngbounds object too.http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLngBoundsThose are the pieces I think you would need.
Mike Williamson
A: 

You can use google fusion tables to geocode your data. Limits are pretty high there.

Eduardo Leoni