使用Google地图避免地理编码限制的备选方法 [英] Alternate ways to avoid geocode limit with Google Maps

查看:148
本文介绍了使用Google地图避免地理编码限制的备选方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个Google地图,可以即时对多个标记进行地理编码,但发现它很快就达到了地理代码限制。



作为一项初步工作,我设定了一个时间每个地理编码请求之间的延迟。这证明是不够的,因为您必须等待X秒钟/分钟才能对每个标记进行地理编码,这意味着标记不会立即绘制出来。

然后,我尝试了Google Fusion即时绘制所有标记但在实时数据处理中遇到困难的表格。似乎没有办法与我的Wordpress数据库一起工作,因此它抓取实时数据。 (或者至少我找不到任何它的例子)。



避免地理编码限制的其他选择是什么?任何人都可以指向正确的方向。



我的要求是:

$ ol

  • 需要立即绘制标记(或至少等待最少的等待时间)。

  • 需要使用我的Wordpress数据。

  • 数据需要实时,即当Wordpress中的某些内容被编辑/更新时,需要将更改过滤到地图数据中。

  • Wordpress中的数据需要进行模糊处理,或者至少难以处理
  • 在不知道更多关于地理编码的信息的情况下,你有没有考虑在你的服务器上缓存结果?如果您对同一个地址提出了很多请求,则一次又一次浪费API调用是没有意义的。



    您必须设置一个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:

    1. Markers need to be plotted instantly (or at least with minimum waiting time).
    2. Needs to work with my Wordpress data.
    3. 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.
    4. 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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆