We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我编写了一个代码片段,可让您通过组合 Google Maps Geocoding API 和 GeoNames.org API(除了 file_get_contents)来检索所有附近的城市strong>您还可以执行cURL请求)。
有关 API 的详细信息,请访问以下网址:
I've written a code snippet that allows you to retrieve all nearby cities by combining the Google Maps Geocoding API and GeoNames.org API (besides a file_get_contents your could also do a cURL request).
For more information about the API's visit the following url's:
您不想使用 Places API 的说法可能是正确的。您可能想看看是否有一种方法可以使用地理编码/反向地理编码来获得您想要的东西。请参阅 http://code.google.com/apis/maps/documentation/geocoding/< /a>.
根据您的性能和准确性要求,您可能无法使用 Google Maps API(或任何其他免费工具)轻松地做到这一点(尤其是在全球范围内),但您可能可以获得一些基本有效的东西,特别是如果您有地理限制(例如,仅限美国),这可能会简化事情。
You are likely correct that you will not want to use the Places API. You may want to see if there is a way to use geocoding/reverse geocoding to get what you want. See http://code.google.com/apis/maps/documentation/geocoding/.
Depending on your performance and accuracy requirements, you may not be able to easily do this (especially globally) with Google Maps API (or any other free tool), but you might be able to get something that sorta kinda mostly-works, especially if you have a geographical restriction (e.g., just the U.S.) that might simplify things.