Google地图地理编码状态OVER_QUERY_LIMIT [英] Google Maps Geocode Status OVER_QUERY_LIMIT

查看:160
本文介绍了Google地图地理编码状态OVER_QUERY_LIMIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,Google每天将请求数上限为2,500个......但是我今天无法在EARTH上发出这么多请求,而且我只是不断收到'OVER_QUERY_LIMIT'

  $ street_no = get_post_meta($ prop-> ID,'street_no',true); 
$ street = get_post_meta($ prop-> ID,'street',true);
$ street_suffix = get_post_meta($ prop-> ID,'street_suffix',true);

$ addr = urlencode($ street_no。。$ street。。$ street_suffix。BC Canada);
$ url ='http://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&sensor=true';
$ json_result = json_decode(file_get_contents($ url));

if($ json_result-> status ===OVER_QUERY_LIMIT):
sleep(2);
$ json_result = json_decode(file_get_contents($ url));
endif;

正如您所看到的,如果我得到 OVER_QUERY_LIMIT 我告诉脚本睡觉2秒钟,然后继续......这似乎在今天早上的某个时刻起作用,但现在我甚至无法获得单个地址的地理编码。



我现在不知道该怎么做......它让我的应用程序完全没用。

解决方案

共享IP的所有用户共享配额,因此同一共享IP上的其他网站必须使用Google Geocoder。



请参阅此线程在Google Maps API v2组中获得更多信息。



BTW - rackspace是一个猜测......

解决方法是使用基于客户端的地理编码,但验证您的使用是否符合使用条款。



webservice现在支持密钥,另一个选项是在你的请求中使用一个键,这样你就可以获得自己的配额。


I understand that Google caps requests to 2,500 per day... but there's no way on EARTH that I've made that many requests today, and I just keep getting 'OVER_QUERY_LIMIT'

$street_no = get_post_meta($prop->ID, 'street_no', true);
$street = get_post_meta($prop->ID, 'street', true);
$street_suffix = get_post_meta($prop->ID, 'street_suffix', true);

$addr = urlencode( $street_no." ".$street." ".$street_suffix." BC Canada" );
$url = 'http://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&sensor=true';
$json_result = json_decode(file_get_contents($url));

if ( $json_result->status === "OVER_QUERY_LIMIT" ) :
    sleep(2);
    $json_result = json_decode(file_get_contents($url));
endif;

As you can see, if I get the status of OVER_QUERY_LIMIT I tell the script to sleep for 2 seconds and then continue on... which seemed to work at some point this morning, but now I just can't even get a single address geocoded.

I'm at a loss as to what to do at this point... it makes my application utterly useless.

解决方案

The quota is shared among all the users of the shared IP, so other sites on the same shared IP must be using the Google Geocoder.

See this thread in the Google Maps API v2 group for more information.

BTW - rackspace was a guess...

A workaround would be to use client based geocoding, but verify your use complies with the terms of use.

The webservice now supports a key, another option is to use a key in your request so you get your own quota.

这篇关于Google地图地理编码状态OVER_QUERY_LIMIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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