gpt4 book ai didi

android - 计算起点到终点的经纬度

转载 作者:行者123 更新时间:2023-11-30 01:08:47 28 4
gpt4 key购买 nike

您好,我是 Android 开发的新手。

我正在进行基于位置的大学项目,需要找到两点之间的经纬度列表。 给定起始位置为 12.990143,80.215784,目标位置为 12.992595,80.217618。

 Over the past days i search the google, i found so many links to find distance between locations and mid point. I cant able to find solution for my problem.

Please suggest some solution for this problem. I am struggling over days to find solution for this.


Thanks in advance

最佳答案

您可以使用 Google Maps API Utility Library 中的 SphericalUtil.interpolate 方法.

例如,您可以通过以下操作找到位于您的起始位置和目的地之间距离的 1/5 处的 LatLng

LatLng origin = new LatLng(12.990143,80.215784);
LatLng destination = new LatLng(12.992595,80.217618);
LatLng result = SphericalUtil.interpolate(origin, destination, 0.2);

关于android - 计算起点到终点的经纬度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38629519/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com