Slow down Geocoding a batch of Address

我是研究僧i 提交于 2019-12-13 05:33:09

问题


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);?


回答1:


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.



来源:https://stackoverflow.com/questions/6510008/slow-down-geocoding-a-batch-of-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!