如何使用PHP对MapQuest地理编码器进行批量地理编码


How do I do bulk geocoding against the MapQuest geocoder using PHP?

是否有人使用MapQuest作为地理编码服务?

我需要的是一个简单的函数,你传递地址,它会得到里面的lat和lng作为结果,只需要它们,不需要其他东西。

例如,谷歌地图api使用这个:

geocoder = new google.maps.Geocoder();
        geocoder.geocode( { 'address': address}, function(results, status) {
         if (status == google.maps.GeocoderStatus.OK) {
          var value1    = results[0].geometry.location.lat();
      var value2    = results[0].geometry.location.lng();
..

什么应该等同于使用地图任务?

谢谢。

MapQuest地理编码Web服务以类似的方式工作。基本上,您需要编写一个脚本,将地址传递给web服务,然后解析响应。你可以循环浏览响应并从中获得纬度和经度

MapQuest在MapQuest开发者网络网站上有一个演示页面和论坛。

希望这能有所帮助!