Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch process with google geocoding api webservices (looking for updates)

Google references this: https://developers.google.com/maps/documentation/javascript/geocoding

And states:

The per-session rate limit prevents the use of client-side services for batch requests, such as batch geocoding. For batch requests, use the Geocoding API web service.

However, when you go to the Geocoding API web services page, I see no reference to batch processing. The above sentence infers that you can do batch processing. I need to send a large number of addresses to get lat and longitude, but doing individual calls for each address is taking extremely long periods of time and need a more efficient method. Hopefully, a single batch call to send all the addresses.

Any ideas of how to batch process addresses on google to get lat and longitude?

I have seen this Google Batch Geocoding API

However, it states you can not which is not what the above google statement infers.

like image 885
Lefty Avatar asked Mar 26 '19 03:03

Lefty


2 Answers

Per the Geocoding API web service documentation:

Other Usage Limits
While you are no longer limited to a maximum number of requests per day (QPD), the following usage limits are still in place for the Geocoding API:

50 requests per second (QPS), calculated as the sum of client-side and server-side queries.

You are just limited to 50 requests per second and have to pay for them (after you use up the $200 credit)

like image 89
geocodezip Avatar answered Nov 02 '22 23:11

geocodezip


The best way I found to solve this problem is to use the Directions API with up to 27 destinations (origin, destination and 25 waypoints) and get your geolocation for the response legs. The position accuracy is slightly lower than in the geocode case from what I observed, but it is still a great tradeoff.

In the worst case you will have to call the Directions API twice when one or more addresses are not found in your call. The good thing in this case is that the Directions API will give you a response with the geocoded_waypoints which will specify the NOT_FOUND locations with a geocoder_status. After that, you can eliminate the bad ones and call again.

like image 44
Daniel T. Avatar answered Nov 03 '22 00:11

Daniel T.