diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java index cf4386f2aa..f4c5323ec0 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java @@ -52,7 +52,6 @@ public class BinaryMapRouteReaderAdapter { public final static int TRAFFIC_SIGNALS = 6; public final static int RAILWAY_CROSSING = 7; private final static int LANES = 8; - private final static int STOP = 9; private final String t; private final String v; private int intValue; @@ -151,8 +150,6 @@ public class BinaryMapRouteReaderAdapter { } } else if(t.equalsIgnoreCase("highway") && "traffic_signals".equals(v)){ type = TRAFFIC_SIGNALS; - } else if(t.equalsIgnoreCase("highway") && "stop".equals(v)){ - type = STOP; } else if(t.equalsIgnoreCase("railway") && ("crossing".equals(v) || "level_crossing".equals(v))){ type = RAILWAY_CROSSING; } else if(t.equalsIgnoreCase("roundabout") && v != null){ diff --git a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java index e6f69d6520..29bd800fcc 100644 --- a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java @@ -685,10 +685,11 @@ public class RouteDataObject { return direction; } - public int isStopApplicable(boolean direction) { - int sz = types.length; + public int isStopApplicable(boolean direction, int intId) { + int[] pt = getPointTypes(intId); + int sz = pt.length; for (int i = 0; i < sz; i++) { - RouteTypeRule r = region.quickGetEncodingRule(types[i]); + RouteTypeRule r = region.quickGetEncodingRule(pt[i]); if (r.getTag().equals("direction")) { String dv = r.getValue(); if ((dv.equals("forward") && direction == true) || (dv.equals("backward") && direction == false)) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index 972f68a8a9..253f9ec25c 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -273,12 +273,10 @@ public class WaypointHelper { AlarmInfo info = AlarmInfo.createAlarmInfo(typeRule, 0, loc); // For STOP first check if it has directional info - // TODO: Check if this is needed here if (info != null && info.getType() != null && info.getType() == AlarmInfoType.STOP) { - if (ro.isStopApplicable(ro.bearingVsRouteDirection(loc)) == -1) { + if (ro.isStopApplicable(ro.bearingVsRouteDirection(loc), i) == -1) { info = null; } - //Toast.makeText(app.getApplicationContext(), Double.toString(ro.directionRoute(0, true)) + ",\n" + Double.toString(loc.getBearing()) + ",\n" + Double.toString(MapUtils.alignAngleDifference(ro.directionRoute(0, true) - loc.getBearing() / 180f * Math.PI))), Toast.LENGTH_LONG).show(); } if (info != null) { diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index eb035bf103..962af18f71 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -191,7 +191,7 @@ public class RouteCalculationResult { loc.setLongitude(MapUtils.get31LongitudeX(x31)); AlarmInfo info = AlarmInfo.createAlarmInfo(typeRule, locInd, loc); // For STOP first check if it has directional info - if ((info != null) && !((info.getType() == AlarmInfoType.STOP) && (res.getObject().isStopApplicable(res.isForwardDirection()) == -1))) { + if ((info != null) && !((info.getType() == AlarmInfoType.STOP) && (res.getObject().isStopApplicable(res.isForwardDirection(), intId) == -1))) { alarms.add(info); } }