From 9d20aaad2a289a980239d1fe00e15d154910781d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 27 Nov 2019 12:00:31 +0100 Subject: [PATCH] Fix result preparation --- .../main/java/net/osmand/router/RouteResultPreparation.java | 6 ++++-- .../src/main/java/net/osmand/util/MapAlgorithms.java | 2 +- OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java index a26220193c..53976a1b74 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1739,8 +1739,10 @@ public class RouteResultPreparation { } }; } else { - RouteSegment rt = ctx.loadRouteSegment(road.getPoint31XTile(pointInd), road.getPoint31YTile(pointInd), ctx.config.memoryLimitation); - it = rt == null ? null : rt.getIterator(); + // Here we assume that all segments should be attached by native + it = null; +// RouteSegment rt = ctx.loadRouteSegment(road.getPoint31XTile(pointInd), road.getPoint31YTile(pointInd), ctx.config.memoryLimitation); +// it = rt == null ? null : rt.getIterator(); } // try to attach all segments except with current id while (it != null && it.hasNext()) { diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java b/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java index fbb0ec4ec0..23307babc9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java @@ -299,7 +299,7 @@ public class MapAlgorithms { * count the intersections when going from lat, lon to outside the ring * @param polyNodes2 */ - private static int countIntersections(Collection polyNodes, double latitude, double longitude) { + public static int countIntersections(Collection polyNodes, double latitude, double longitude) { int intersections = 0; if (polyNodes.size() == 0) return 0; diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java index 5046193814..dffbd72ad5 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java @@ -4,7 +4,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import net.osmand.Location; import net.osmand.data.LatLon; import net.osmand.data.MapObject; import net.osmand.data.QuadPoint; @@ -80,8 +79,6 @@ public class MapUtils { // not very accurate computation on sphere but for distances < 1000m it is ok double mDist = (fromLat - toLat) * (fromLat - toLat) + (fromLon - toLon) * (fromLon - toLon); double projection = scalarMultiplication(fromLat, fromLon, toLat, toLon, lat, lon); - double prlat; - double prlon; if (projection < 0) { return 0; } else if (projection >= mDist) {