Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 计算从起点到终点的纬度和经度_Android_Google Maps_Android Location_Android Maps - Fatal编程技术网

Android 计算从起点到终点的纬度和经度

Android 计算从起点到终点的纬度和经度,android,google-maps,android-location,android-maps,Android,Google Maps,Android Location,Android Maps,嗨,我是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

嗨,我是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

您可以从中使用
spherecalutil.interpolate
方法

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

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

可以使用google Directions api获取路径的完整多段线。您可以objain一个JSON对象并对其进行解析,以获取路径中的位置

这将返回一个完整的JSON结果,其中包含查找到所有点的整个路径所需的所有内容

您可以在以下网站了解更多信息:


A上述两点之间的间隙?在直线上?@GeetChoubey是的在直线上检查这个:我正在试图理解你做了什么。你也可以去看看。希望能有帮助。这是他们的是,我尝试了这个方向api,它返回道路中的经纬度路径。但我需要在直线和出口列表位置的纬度和经度列表。