From 758d4cc80cd50d817c2469016ef085022a3d4cbc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 9 Dec 2015 23:24:06 +0100 Subject: [PATCH] Update naming --- .../src/net/osmand/binary/GeocodingUtilities.java | 12 ++++++------ .../src/net/osmand/router/BinaryRoutePlanner.java | 6 +++--- .../src/net/osmand/router/RoutePlannerFrontEnd.java | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/binary/GeocodingUtilities.java b/OsmAnd-java/src/net/osmand/binary/GeocodingUtilities.java index f1617e4179..85f5aafcd8 100644 --- a/OsmAnd-java/src/net/osmand/binary/GeocodingUtilities.java +++ b/OsmAnd-java/src/net/osmand/binary/GeocodingUtilities.java @@ -151,7 +151,7 @@ public class GeocodingUtilities { List lst = new ArrayList(); List listR = new ArrayList(); rp.findRouteSegment(lat, lon, ctx, listR); - double dist = 0; + double distSquare = 0; TLongHashSet set = new TLongHashSet(); Set streetNames = new HashSet(); for(RouteSegmentPoint p : listR) { @@ -161,8 +161,8 @@ public class GeocodingUtilities { } boolean emptyName = Algorithms.isEmpty(road.getName()) && Algorithms.isEmpty(road.getRef()) ; if(!emptyName) { - if(dist == 0 || dist > p.dist) { - dist = p.dist; + if(distSquare == 0 || distSquare > p.distSquare) { + distSquare = p.distSquare; } GeocodingResult sr = new GeocodingResult(); sr.searchPoint = new LatLon(lat, lon); @@ -175,11 +175,11 @@ public class GeocodingUtilities { lst.add(sr); } } - if(p.dist > STOP_SEARCHING_STREET_WITH_MULTIPLIER_RADIUS * STOP_SEARCHING_STREET_WITH_MULTIPLIER_RADIUS && - dist != 0 && p.dist > THRESHOLD_MULTIPLIER_SKIP_STREETS_AFTER * dist ) { + if(p.distSquare > STOP_SEARCHING_STREET_WITH_MULTIPLIER_RADIUS * STOP_SEARCHING_STREET_WITH_MULTIPLIER_RADIUS && + distSquare != 0 && p.distSquare > THRESHOLD_MULTIPLIER_SKIP_STREETS_AFTER * distSquare ) { break; } - if(p.dist > STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS*STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS) { + if(p.distSquare > STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS*STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS) { break; } } diff --git a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java index 2c3ad11768..406b8b896f 100644 --- a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java @@ -835,12 +835,12 @@ public class BinaryRoutePlanner { } public static class RouteSegmentPoint extends RouteSegment { - public RouteSegmentPoint(RouteDataObject road, int segmentStart, double dist) { + public RouteSegmentPoint(RouteDataObject road, int segmentStart, double distSquare) { super(road, segmentStart); - this.dist = dist; + this.distSquare = distSquare; } - public double dist; + public double distSquare; public int preciseX; public int preciseY; public List others; diff --git a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java index 0104b5ee72..3ee2a1acb3 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java @@ -72,10 +72,10 @@ public class RoutePlannerFrontEnd { for (int j = 1; j < r.getPointsLength(); j++) { QuadPoint pr = MapUtils.getProjectionPoint31(px, py, r.getPoint31XTile(j - 1), r.getPoint31YTile(j - 1), r.getPoint31XTile(j ), r.getPoint31YTile(j )); - double currentsDist = squareDist((int) pr.x, (int)pr.y, px, py); - if (road == null || currentsDist < road.dist) { + double currentsDistSquare = squareDist((int) pr.x, (int)pr.y, px, py); + if (road == null || currentsDistSquare < road.distSquare) { RouteDataObject ro = new RouteDataObject(r); - road = new RouteSegmentPoint(ro, j, currentsDist); + road = new RouteSegmentPoint(ro, j, currentsDistSquare); road.preciseX = (int) pr.x; road.preciseY = (int) pr.y; }