对多个地址进行地理编码
我需要对每个请求大约 200 个地址进行地理编码,每天执行大约 3,000 个请求。 我将使用 PHP 来做这个服务器端。 我看过如何将地址转换为纬度/经度?< /a>,但无法找到 Google 地图 HTTP 请求 API 或雅虎地理编码 REST API(无法使用 JavaScript,因为这是服务器端)发送多个地址的方法。
我将主要使用它根据坐标对地址进行排序,如果 API 支持,请填写每个地址的任何缺失数据。 这些地址仅位于美国。 地理编码的地址将来自用户输入,因此可以是自由形式,例如“街道地址、邮政编码”或“城市、州”等。对于坐标来说,精度并不是太重要,例如在五百英尺左右的范围内。
有免费的 API 来处理这个问题吗? 有没有办法让雅虎或谷歌在一个请求中执行多个位置?
I need to geocode around 200 addresses per request and do around 3,000 request per day. I will be doing this server side using PHP. I have looked at How to convert an address to a latitude/longitude?, but could not find a way for either Google Maps HTTP Request API or the Yahoo Geocoding REST API (cannot use JavaScript as this is server side) to send multiple addresses.
I will be primarily using this to sort addresses based on the coordinates and if the API supports, fill in any missing data for each address. The addresses will be in the United States only. The addresses to geocode will be from user input, so be free form, like "street address, postal code", or "city, state", etc. Accuracy is not too important for the coordinates, say within five hundred feet or so.
Is there a free API to handle this? Is there a way to get Yahoo or Google to do multiple locations in a request?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我研究了 Google Maps API、Yahoo Maps Api、MapQuest API 和 Microsoft Virtual Earth API。 这些免费服务均不允许批量地理编码。
但是,Google 地图 API 每天允许 15,000 个 goecode。 但他们不喜欢你一次发送太多。 他们建议在请求之间等待 200 毫秒。 顺便说一句,他们通过 IP 地址跟踪您。
雅虎每天允许 5,000 个,并且也是一个易于使用的 api。
Microsoft Virtual Earth 每天允许 5,000 个,但 api 文档令人头疼。
MapQuest 很奇怪,并且似乎没有给出好的结果(我见过的最不准确的结果)。
实际上,我已经将代码设置为在多个服务之间交替,这样我就可以一次发出多个请求。 这有点模拟批量编码。
I've looked at the Google Maps api, Yahoo Maps Api, MapQuest API, and the Microsoft Virtual Earth API. None of these free services allow bulk geocoding.
But, Google Maps api allows 15,000 goecodes per day. But they don't like it when you send too many at one time. They suggest waiting 200ms between requests. They track you by IP address btw.
Yahoo allows 5,000 per day, and is also an easy api to use.
Microsoft Virtual Earth allows 5,000 per day, but the api documentation is a pain in the butt.
MapQuest is just strange, and doesn't seem to give good results (least accurate of all that I've seen).
I've actually set up my code to alternate between several services so I can make multiple requests at once. This - sort of - simulates bulk encoding.
geocoder.us 会执行您想要的操作,但批量查找可能会遇到相同的问题。 不过,他们进行批量查找是收费的。
GeoNames 能否通过大量原始数据或通过其 网络服务?
geocoder.us will do what you want, but you may have the same problem for bulk lookups. They do bulk lookups for a fee though.
Would GeoNames provide sufficient information, either through the bulk raw data or via their web services?
USC WebGIS 地理编码器 提供多个地理编码 API 可以执行此操作。 它是免费的,允许从您的代码中批量查找,或者您可以上传数据库进行批量处理。
The USC WebGIS Geocoder offers several geocoding API's that can do this. It's free and allows batch lookups from your code, or you can upload a database for batch processing.
Mapquest 有一个允许批量地理编码的 API。 然而他们不直接为 PHP 提供一个。 但是您可以查找他们的协议文档 http://developer.mapquest.com/Library/SDK_Documentation/自己实现的协议。 他们可能在文档中将批量地理编码称为位置集合。
Mapquest has an API which allows batch geocoding. However they don't provide one directly for PHP. But you can look up their protocol documentation http://developer.mapquest.com/Library/SDK_Documentation/Protocols to implement it yourself. They may refer to bulk geocoding as a Location Collection in the docs.
这可能听起来很奇怪,但我不久前做了一个网站,客户希望用户只输入一个邮政编码,我们将提供剩余的数据。 我使用了 yahoo 天气 api,当时它返回了一个包含所有天气数据的 xml 文件,并且 ciy、state、zip 对于美国的地址效果很好
This might sound odd but I did a site a while ago and the client wanted the user to enter only a zip and we would provide the remaining data. I used the yahoo weather api which, at the time, returned a xml file with all the weather data, and the ciy,state,zip worked well for addresses in the US
查看 http://www.torchproducts.com/tools/geocode 对地址列表进行地理编码迅速地
Look at http://www.torchproducts.com/tools/geocode to geocode a list of addresses quickly
使用 GDirections。 它一次允许最多 25 个航点,并为每个航点返回一个地理编码位置。
Use GDirections. It allows up to 25 waypoints at a time and returns a geocoded location for each one.