From 8e755d6339fbbfcfa251f5af431d1ed51337b8e2 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 3 Mar 2021 11:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E4=B8=AD?= =?UTF-8?q?=E7=82=B9=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/map/impl/custom/utils/PointInterpolatorUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/PointInterpolatorUtil.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/PointInterpolatorUtil.java index 5ee4c5faeb..c6b516da68 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/PointInterpolatorUtil.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/PointInterpolatorUtil.java @@ -45,6 +45,8 @@ public class PointInterpolatorUtil { getCloseTwoPoint(lon, lat, road); LonLatPoint start = road.get(closeStart); LonLatPoint end = road.get(closeEnd); + Logger.d(TAG, "mergeToRoad start: " + closeStart + " end: " + closeEnd); +// return getMid(start, end); return getFoot(lon, lat, start, end); } @@ -76,4 +78,8 @@ public class PointInterpolatorUtil { u = u / (dx * dx + dy * dy); return new double[]{ beginPt.getLongitude() + u * dy, beginPt.getLatitude() + u * dx}; } + + private static double[] getMid(LonLatPoint start, LonLatPoint end) { + return new double[]{(start.getLongitude() + end.getLongitude()) / 2, (start.getLatitude() + end.getLatitude()) / 2}; + } }