From 1b9a01bf5000714b08a75a50dd1f5f3eab65d888 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期五, 08 十二月 2023 17:18:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-other/src/main/java/com/dsh/other/util/GeodesyUtil.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/util/GeodesyUtil.java b/cloud-server-other/src/main/java/com/dsh/other/util/GeodesyUtil.java index 9824ee6..4e3978b 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/util/GeodesyUtil.java +++ b/cloud-server-other/src/main/java/com/dsh/other/util/GeodesyUtil.java @@ -16,11 +16,12 @@ /** * 获取直线距离 + * * @param fromLonLat * @param toLonLat * @return */ - public static Map<String, Double> getDistance(String fromLonLat, String toLonLat){ + public static Map<String, Double> getDistance(String fromLonLat, String toLonLat) { String[] from = fromLonLat.split(","); String[] to = toLonLat.split(","); GlobalCoordinates source = new GlobalCoordinates(Double.valueOf(from[1]), Double.valueOf(from[0])); @@ -54,7 +55,7 @@ } - private static double getDistanceMeter(GlobalCoordinates gpsFrom, GlobalCoordinates gpsTo, Ellipsoid ellipsoid){ + private static double getDistanceMeter(GlobalCoordinates gpsFrom, GlobalCoordinates gpsTo, Ellipsoid ellipsoid) { //创建GeodeticCalculator,调用计算方法,传入坐标系、经纬度用于计算距离 GeodeticCurve geoCurve = new GeodeticCalculator().calculateGeodeticCurve(ellipsoid, gpsFrom, gpsTo); return geoCurve.getEllipsoidalDistance(); -- Gitblit v1.7.1