| | |
| | | GlobalCoordinates target = new GlobalCoordinates(latitudeTo, longitudeTo); |
| | | return geodeticCalculator.calculateGeodeticCurve(Ellipsoid.WGS84, source, target).getEllipsoidalDistance(); |
| | | } |
| | | public static double getDistance(Double[] From, Double[] To) { |
| | | double longitudeFrom = From[0]; |
| | | double latitudeFrom = From[1]; |
| | | double longitudeTo = To[0]; |
| | | double latitudeTo = To[1]; |
| | | GlobalCoordinates source = new GlobalCoordinates(latitudeFrom, longitudeFrom); |
| | | GlobalCoordinates target = new GlobalCoordinates(latitudeTo, longitudeTo); |
| | | return geodeticCalculator.calculateGeodeticCurve(Ellipsoid.WGS84, source, target).getEllipsoidalDistance(); |
| | | } |
| | | /** |
| | | * 根据经纬度,计算两点间的距离 |
| | | * |