【问题标题】:fetching the latitude and longitude of a location获取位置的纬度和经度
【发布时间】:2012-09-22 14:04:13
【问题描述】:

我正在使用 curl 获取特定位置的纬度和经度。即使到今天早上我也得到了正确的回应。但现在我得到了一些状态,比如“OVER_QUERY_LIMIT”。如果我从不同的文件运行相同的代码,那么它就可以工作。 我的代码是这样的:

$last_url = "http://maps.google.com/maps/api/geocode/json?     address=44+Church+st++Parramatta+2150+Australia&sensor=false";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $last_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/*curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);*/
$response = curl_exec($ch);
//echo "++++++++++";
echo $response;
curl_close($ch);

$output = json_decode($response);
echo $lat = $output->results[0]->geometry->location->lat;
echo  $long = $output->results[0]->geometry->location->lng;

请帮帮我。

【问题讨论】:

    标签: php curl geomap


    【解决方案1】:

    问题很明显,不是吗?您每天只能进行一定数量的查询。还有一个速率限制。你超越了这些限制之一。如果它在一个脚本而不是另一个脚本中工作,您可能会达到速率限制。请等待几分钟,然后重试。

    https://developers.google.com/maps/documentation/geocoding/#Limits

    【讨论】:

      猜你喜欢
      • 2012-11-08
      • 2021-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多