获取位置的纬度和经度

时间:2012-09-22 14:04:13

标签: php curl geomap

我使用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;

请帮帮我。

1 个答案:

答案 0 :(得分:1)

问题很明显,不是吗?您每天仅限于一定数量的查询。还有一个房价限制。你超越了其中一个限制。如果它在一个脚本而不是另一个脚本中工作,则可能达到了速率限制。等几分钟再试一次。

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

相关问题