Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5887e41704
4 changed files with 6 additions and 10 deletions
|
@ -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){
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue