From e15dece046e0172300b03a9043b373886d683974 Mon Sep 17 00:00:00 2001 From: Kseniia Date: Tue, 2 Mar 2021 11:17:30 +0200 Subject: [PATCH] Add minor stop 10281 --- OsmAnd-java/build.gradle | 1 + .../osmand/router/RouteResultPreparation.java | 51 ++----------------- 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/OsmAnd-java/build.gradle b/OsmAnd-java/build.gradle index d461ea8aff..d4e77b9d85 100644 --- a/OsmAnd-java/build.gradle +++ b/OsmAnd-java/build.gradle @@ -112,6 +112,7 @@ dependencies { implementation group: 'org.json', name: 'json', version: '20171018' implementation 'it.unibo.alice.tuprolog:tuprolog:3.2.1' implementation 'org.apache.commons:commons-compress:1.17' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' implementation 'com.moparisthebest:junidecode:0.1.1' implementation 'com.vividsolutions:jts-core:1.14.0' implementation 'com.google.openlocationcode:openlocationcode:1.0.4' 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 417f4f3511..d79bbc53da 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -203,59 +203,16 @@ public class RouteResultPreparation { for (int stop : stops) { List attachedRoutes = seg.getAttachedRoutes(stop); for (RouteSegmentResult attached : attachedRoutes) { - int attStopPriority = highwayStopPriority(attached.getObject().getHighway()); - int segStopPriority = highwayStopPriority(seg.getObject().getHighway()); - if (segStopPriority > attStopPriority) { + int attStopPriority = highwaySpeakPriority(attached.getObject().getHighway()); + int segStopPriority = highwaySpeakPriority(seg.getObject().getHighway()); + if (segStopPriority < attStopPriority) { seg.getObject().removePointType(stop, seg.getObject().region.stopSign); + break; } } } - return seg; } - - private int highwayStopPriority(String highway) { - if (highway.endsWith("trunk")) { - return 13; - } - if (highway.endsWith("trunk_link")) { - return 12; - } - if (highway.endsWith("primary")) { - return 11; - } - if (highway.endsWith("primary_link")) { - return 10; - } - if (highway.endsWith("secondary")) { - return 9; - } - if (highway.endsWith("secondary_link")) { - return 8; - } - if (highway.endsWith("tertiary")) { - return 7; - } - if (highway.endsWith("tertiary_link")) { - return 6; - } - if (highway.endsWith("residential")) { - return 5; - } - if (highway.endsWith("living_street")) { - return 4; - } - if (highway.endsWith("track")) { - return 3; - } - if (highway.endsWith("footway")) { - return 2; - } - if (highway.endsWith("path")) { - return 1; - } - return 0; - } public void prepareTurnResults(RoutingContext ctx, List result) { for (int i = 0; i < result.size(); i ++) {