Nyxynyx
Nyxynyx

Reputation: 63619

Slow down Geocoding a batch of Address

I'm planning to use the Google Maps V3 API to geocode a batch of address stored in an array. These address will be retrieved from my database and geocoded so I can create markers for them on the map.

However I understand that Google has placed a limit on the rate of geocoding requests sent to them, so I am wondering how I can use PHP to limit the rate of geocoding requests, to maybe 1 geocode every 10 seconds?

sleep(10);?

Upvotes: 0

Views: 830

Answers (1)

Adam Hopkinson
Adam Hopkinson

Reputation: 28795

Yep, sleep(10) would do that.

Alternatively, run the geocoding using javascript on the client machine. The rate limiting is based on the IP address, so you can spread this out over your visitors by having their browser do the geocode.

Upvotes: 1

Related Questions