Android GPS坐标距离计算
来源:互联网 发布:深圳盘古数据上市了没 编辑:程序博客网 时间:2024/05/16 00:50
Android GPS坐标距离计算
Android API :
Android API–Location
http://androiddoc.qiniudn.com/reference/android/location/Location.htm
public float distanceTo (Location dest)
Added in API level 1
Returns the approximate distance in meters between this location and
the given location. Distance is defined using the WGS84 ellipsoid.Parameters dest the destination location Returns • the approximate
distance in meters
Location
Location API 接口
http://androiddoc.qiniudn.com/reference/android/location/Location.html
百度地图API:
static double getDistance(LatLng p1LL, LatLng p2LL)
返回两个点之间的距离
示例代码:
两种计算方式精确度对比:
LatLng latLng1 = new LatLng(37.014232, 117.565597);LatLng latLng2 = new LatLng(31.137012, 121.345326);double mDistance = DistanceUtil.getDistance(latLng1, latLng2);Log.e(TAG, "onCreate: 百度-距离:" + mDistance + "米");Location location1 = new Location("l1");location1.setLatitude(37.014232);location1.setLongitude(117.565597);Location location2 = new Location("l2");location2.setLatitude(31.137012);location2.setLongitude(121.345326);
07-08 10:17:47.678 27561-27561/baidumapsdk.demo E/MainActivity:
onCreate: 百度-距离:740275.3203764297米 07-08 10:17:47.678
27561-27561/baidumapsdk.demo E/MainActivity: onCreate:
谷歌-距离:740275.3203764297米
Create by zhangswings
- Android GPS坐标距离计算
- GPS定位坐标计算距离
- mysq计算两个gps坐标的距离
- Javascript计算两个GPS坐标的距离
- 计算两个gps坐标之间的距离
- scala-计算两个GPS坐标的距离
- GPS两坐标点距离计算
- scala-计算两个GPS坐标的距离
- 计算2个GPS坐标的距离
- 坐标 多种数据库计算GPS经纬度坐标距离
- Android给定坐标计算距离
- GPS坐标(大地坐标)转高斯平面坐标,并计算 GPS 坐标(大地坐标)两点间的距离
- 计算两个GPS经纬度坐标之间的距离 PHP
- 计算两个GPS坐标的距离 方法一 - C#语言
- 计算两个GPS坐标的距离 方法二 - C语言
- 计算两个GPS坐标的距离 方法三 - C++语言
- 计算两个GPS坐标的距离 方法四 - Java语言
- java根据GPS经纬度坐标计算两点的距离算法
- Universal-Image-Loader使用小记
- 本科毕业生活感悟
- 基于DotSpatial实现面积测量图层
- JAVA自学之每日一题(七)
- 欢迎使用CSDN-markdown编辑器
- Android GPS坐标距离计算
- 235. Lowest Common Ancestor of a Binary Search Tree
- Robert 的军队
- 一个简易的视屏播放器
- CSS3 涟漪效果
- HDU 3232Crossing Rivers(数学期望)
- Mybatis配置报错元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectF
- centos安装php扩展imagick-高性能处理图片
- python 接受远程数据并写入数据库的相关模块