如何使用 Google Maps API v2 确定道路上的经纬度坐标

2023-12-27

我已经使用了谷歌地理地址并使用纬度/经度得到了地址。如何确定我是否在路上?基本上是道路碰撞测试?我目前正在使用位置管理器来管理纬度/经度,并且公路上和公路旁的地理地址相同。


最终解决方案

Use 通过 Google Geocoding API 进行反向地理编码 https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding.

术语“地理编码”通常是指翻译人类可读的内容 地址转换为地图上的位置。做相反的过程, 将地图上的位置转换为人类可读的地址是 称为反向地理编码。

Geocoding API 支持直接使用 latlng 进行反向地理编码 范围。例如,以下查询包含 布鲁克林某个位置的纬度/经度值:

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false

文档解释了如何解释 json 结果,但 StackOverflow 有各种答案,解决了解析数据的更有效方法。

  • https://stackoverflow.com/a/8095967/1085891 https://stackoverflow.com/a/8095967/1085891
  • https://stackoverflow.com/a/8314094/1085891 https://stackoverflow.com/a/8314094/1085891
  • https://stackoverflow.com/a/6335080/1085891 https://stackoverflow.com/a/6335080/1085891

可能的解决方案

  • 在android中获取最近的街道/道路坐标 https://stackoverflow.com/questions/18607180/getting-the-nearest-street-road-coordinates-in-android- 这个问题的答案可能会为您指明正确的方向。

    您可以直接使用路线 api:

    您能否使用 API 来查找方向,然后提供最近的道路?

  • 在 Android 地图 v2 上将位置固定在道路上 https://stackoverflow.com/questions/18700915/stick-position-to-road-on-android-maps-v2
  • GPS 定位器 - 使用 GPS 查找当前(最近)位置的应用程序 http://www.codeproject.com/Articles/112044/GPSLocator-App-to-Find-Current-Nearest-Location-us- 可能有帮助;对此不太确定。
  • 捕捉到道路 Android https://stackoverflow.com/questions/3272427/snap-to-roads-android- 完全相同的问题

快速搜索结果

  • 捕捉到最近的街道 https://stackoverflow.com/questions/805792/snap-to-nearest-street
  • 地图 API 博客 http://googlemapsapi.blogspot.com/2007_06_01_archive.html using GDirections.loadFromWaypoints https://developers.google.com/maps/documentation/javascript/v2/reference?csw=1#GDirections
  • 在给定经纬度位置的情况下查找最近的街道 https://stackoverflow.com/questions/6582479/finding-nearest-street-given-a-lat-long-location
  • Google Maps Android API V2 中从我的位置到目的地的驾驶路线 http://wptrafficanalyzer.in/blog/driving-route-from-my-location-to-destination-in-google-maps-android-api-v2/

未解决的类似问题

  • 仅在 Google 地图 V2 android 中追踪道路上的位置 https://stackoverflow.com/questions/17724649/trace-the-location-only-on-road-in-google-maps-v2-android
  • https://stackoverflow.com/questions/18081417/google-maps-v2-snap-to-road-issue https://stackoverflow.com/questions/18081417/google-maps-v2-snap-to-road-issue
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 Google Maps API v2 确定道路上的经纬度坐标 的相关文章

随机推荐