【问题标题】:calculate distance between two coordinates for car [duplicate]计算汽车的两个坐标之间的距离[重复]
【发布时间】:2012-06-18 12:35:01
【问题描述】:

可能重复:
Get the distance between two geo points

distanceTo(Location dest)distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results)

是计算人们步行或开车的距离吗?

如何计算汽车两个坐标之间的距离?

【问题讨论】:

    标签: android


    【解决方案1】:

    快速谷歌一下,我找到了很多关于坐标的公式,其中包括你正在处理的内容:

    http://www.movable-type.co.uk/scripts/latlong.html

    【讨论】:

      【解决方案2】:

      您可以通过以下方式获取 2 个地址的距离: http://maps.googleapis.com/maps/api/distancematrix/xml?origins="+a+"&destinations="+b+"&mode=driving&language=en-EN&sensor=false

      祝你好运。

      【讨论】:

      • 什么是a和b?,但只有坐标?
      • a,b 是纬度或地址
      【解决方案3】:

      根据文档,两点之间的距离是它们之间的直线。如果您想要两辆车之间的距离和街道等因素,您需要更多的航路点:

      计算两个位置之间的近似距离(以米为单位),以及 可选的最短路径的初始和最终方位 他们。使用 WGS84 椭球定义距离和方位。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-02-12
        • 2018-06-12
        • 1970-01-01
        • 2017-07-29
        • 1970-01-01
        • 1970-01-01
        • 2014-11-27
        • 1970-01-01
        相关资源
        最近更新 更多