From 4d91f9b451c3c65c25172d63db96cfba95992521 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 8 Jul 2019 01:30:33 +0200 Subject: [PATCH] Add additional tags --- .../java/net/osmand/render/RenderingRuleProperty.java | 3 ++- .../java/net/osmand/router/RouteResultPreparation.java | 2 +- .../java/net/osmand/router/RouteStatisticsHelper.java | 8 ++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleProperty.java b/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleProperty.java index 02fc159f83..228430b01f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleProperty.java +++ b/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleProperty.java @@ -290,7 +290,8 @@ public class RenderingRuleProperty { return false; } String val2 = req.getStorage().getStringValue(vl); - return val != null && val.equals(val2); + return val != null && (val.equals(val2) || + (val2.indexOf(';') != -1 && val2.contains(val+';'))); } int k = val.indexOf('='); 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 3091045b99..89dee125f9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -613,7 +613,7 @@ public class RouteResultPreparation { println(msg); - //calculateStatistics(result); +// calculateStatistics(result); } private void calculateStatistics(List result) { diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java index d2fa83f6bb..a32d56e63f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java @@ -352,7 +352,7 @@ public class RouteStatisticsHelper { //String additional = attrName + "=" + attribute; RouteDataObject obj = segment.obj; int[] tps = obj.getTypes(); - String additional = slopeClass != null ? slopeClass : ""; + String additional = slopeClass != null ? (slopeClass + ";") : ""; for (int k = 0; k < tps.length; k++) { BinaryMapRouteReaderAdapter.RouteTypeRule tp = obj.region.quickGetEncodingRule(tps[k]); if (tp.getTag().equals("highway") || tp.getTag().equals("route") || @@ -360,11 +360,7 @@ public class RouteStatisticsHelper { req.setStringFilter(rrs.PROPS.R_TAG, tp.getTag()); req.setStringFilter(rrs.PROPS.R_VALUE, tp.getValue()); } else { - // TODO -// if (additional.length() > 0) { -// additional += ";"; -// } -// additional += tp.getTag() + "=" + tp.getValue(); + additional += tp.getTag() + "=" + tp.getValue() + ";"; } } req.setStringFilter(rrs.PROPS.R_ADDITIONAL, additional);