两条道路交叉口的地址解析 [英] Geocode of a Intersection of Two Roads

查看:76
本文介绍了两条道路交叉口的地址解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人可以输入google maps API或任何其他API的方法或API或格式,以便我可以可靠地获取相交的经度和纬度?例如,如果我输入宾夕法尼亚州费城的13th and Walnut av"或宾夕法尼亚州费城的13th and Walnut av"(最好是第一个),API会可靠地返回纬度和经度.当我执行http请求时,Google Maps API地理编码偶尔会正确处理,但不够频繁且没有任何模式.有时,非常相似的请求会在第一次成功后再失败,第二次失败通常是因为API无法找到位置.我最好希望有一个免费计划的API.

Does anyone have a method or an API or a format that I can enter into the google maps API or any other API so I can get a latitude and longitude of an intersection reliably? For example if I enter "13th and Walnut, Philadelphia, PA" or "13th st and Walnut av, Philadelphia PA" (preferably the first one) the API reliably returns the latitude and longitude. Google maps API geocoding, when I do a http request, will occasionally get it right, but not often enough and without any pattern. Sometimes very similar requests will succeed the first time and then fail the second, with the API most often failing to find a location. I preferably would like an API with a free plan.

推荐答案

我认为地理编码API 是您的最佳选择.地理编码是将地址(例如"1600 Amphitheatre Parkway,Mountain View,CA")转换为地理坐标(例如纬度37.423021和经度-122.083739)的过程,可用于在地图上放置标记或定位地图.

I think Geocoding API is the best option for you. Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map.

如果您想通过HTTP访问Google Maps Geocoding API,则可以按照上面的文档链接中的指南进行操作.

If you want to access the Google Maps Geocoding API over HTTP, then you can follow the guidelines in the documentation link above.

https://maps.googleapis.com/maps/api/geocode/json?address=13th%20and%20Walnut,%20Philadelphia,%20PA

此请求将为您返回"lat" : 39.95043578029149"lng" : -75.1607739197085.

如果您想知道如何编写代码,则可以检查示例代码此处和此 jsfiddle

And if you want to know how to code it, then you can check the sample code here and this jsfiddle

关于免费计划的问题,每天最多可以免费请求Geocoding API 2500个请求.而且,如果您达到此上限,则会向您收取$ 0.50 USD/1,000个额外请求,每天最多100,000个请求.

For your question about FREE PLAN, Geocoding API is free up to 2,500 request per day. And if you reach this limit, it will charge you a $0.50 USD / 1,000 additional requests, up to 100,000 request daily.

有关Google MAPS API的价格详细信息,请查看此链接.

For more information about Price details of Google MAPS API, check this link.

这篇关于两条道路交叉口的地址解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆