使用Google地图避免地理编码限制的备选方法 [英] Alternate ways to avoid geocode limit with Google Maps
问题描述
我现在有一个Google地图,可以即时对多个标记进行地理编码,但发现它很快就达到了地理代码限制。
作为一项初步工作,我设定了一个时间每个地理编码请求之间的延迟。这证明是不够的,因为您必须等待X秒钟/分钟才能对每个标记进行地理编码,这意味着标记不会立即绘制出来。
然后,我尝试了Google Fusion即时绘制所有标记但在实时数据处理中遇到困难的表格。似乎没有办法与我的Wordpress数据库一起工作,因此它抓取实时数据。 (或者至少我找不到任何它的例子)。避免地理编码限制的其他选择是什么?任何人都可以指向正确的方向。
我的要求是:
$ ol
您必须设置一个PHP脚本作为代理,在数据库的缓存表中查找地址,如果存在,则从数据库返回值。如果它不存在,请进行API调用,将结果存储在您的数据库中,然后返回经过地理编码的信息。
如果每个请求用于不同的地址,您几乎不会对同一个地址进行多次地理编码,那么这不是您的解决方案。
I currently have a Google map that geocodes multiple markers on the fly but found it was quickly hitting the geocode limit.
As an initial work around I set a time delay between each geocode request. This proved inadequate as you have to wait X amount of seconds/minutes for it to geocode each marker, meaning the markers aren't plotted instantly.
I then tried Google Fusion Tables which plotted all the markers instantly but proved difficult in working with real time data. There seems no way for it to work with my Wordpress database so it's grabbing the real time data. (or atleast I can't find any examples that it does).
What are the other alternatives to avoiding the geocode limit? Can anyone point me in the right direction.
My requirements are:
- Markers need to be plotted instantly (or at least with minimum waiting time).
- Needs to work with my Wordpress data.
- Data needs to be real-time i.e when something is edited/updated in Wordpress the change needs to filter through to the map data.
- Data from Wordpress needs to be obfuscated or at least difficult to get hold of.
Without knowing more about what you're geocoding, and why, have you considered caching the results on your server? If you're making many requests for the same address, it doesn't make sense to waste the API calls over and over again.
You would have to set up a PHP script as a proxy, look up the address in a cache table in your database, and if it exists, return the value from the DB. If it doesn't exists, make the API call, store the results in your DB, then return the geocoded information.
If each request is for a different address, and you hardly ever geocode the same address more than once, then this isn't the solution for you.
这篇关于使用Google地图避免地理编码限制的备选方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!