我如何在没有收到OVER_QUERY_LIMIT回应的情况下使用Geocode 20地址? [英] How do I Geocode 20 addresses without receiving an OVER_QUERY_LIMIT response?

查看:105
本文介绍了我如何在没有收到OVER_QUERY_LIMIT回应的情况下使用Geocode 20地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google Geocoder v3,如果我试图对20个地址进行地址解析,我会得到一个OVER_QUERY_LIMIT,除非我将它们分开的时间间隔约为1秒,但在标记全部放置之前需要20秒。

b
$ b

除了预先存储坐标之外,是否还有其他方法可以实现它?

解决方案

不,没有其他办法:如果你有很多地点并想在地图上显示它们,最好的解决方案是:


  • 在创建位置时使用地理编码器获取纬度和经度

  • 将数据存储在数据库中并与地址一起存储

  • 并在你想显示地图时使用存储的纬度+经度。



这当然是因为你有很多减少创建/修改地点的数量,而不是与地点咨询相关。





是的,这意味着您需要做更多的工作节省位置ons - 但它也意味着:


  • 您可以按地理坐标搜索




    • 显示地图将会显示在地图上快得多


      • 即使有超过20个位置


    • 哦,还有(最后但并非最不重要):这会起作用;-)


      • 在N秒内达到X个地理编码器调用的限制。

      • 而且您每天都不太可能达到Y个地理编码器调用的限制。 / li>

      Using the Google Geocoder v3, if I try to geocode 20 addresses, I get an OVER_QUERY_LIMIT unless I time them to be ~1 second apart, but then it takes 20 seconds before my markers are all placed.

      Is there any other way to do it, other than storing the coordinates in advance?

      解决方案

      No, there is not really any other way : if you have many locations and want to display them on a map, the best solution is to :

      • fetch the latitude+longitude, using the geocoder, when a location is created
      • store those in your database, alongside the address
      • and use those stored latitude+longitude when you want to display the map.

      This is, of course, considering that you have a lot less creation/modification of locations than you have consultations of locations.


      Yes, it means you'll have to do a bit more work when saving the locations -- but it also means :

      • You'll be able to search by geographical coordinates
        • i.e. "I want a list of points that are near where I'm now"
      • Displaying the map will be a lot faster
        • Even with more than 20 locations on it
      • Oh, and, also (last but not least) : this will work ;-)
        • You will less likely hit the limit of X geocoder calls in N seconds.
        • And you will less likely hit the limit of Y geocoder calls per day.

      这篇关于我如何在没有收到OVER_QUERY_LIMIT回应的情况下使用Geocode 20地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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