allow multiple segments for rerouting

This commit is contained in:
afischerdev 2024-01-19 16:40:56 +01:00
parent e5ecd14ce1
commit 1bf367b43e

View file

@ -659,7 +659,8 @@ public class RoutingEngine extends Thread {
routingContext.inverseDirection = false; routingContext.inverseDirection = false;
wptIndex = i + 1; wptIndex = i + 1;
} else { } else {
seg = searchTrack(matchedWaypoints.get(i), matchedWaypoints.get(i + 1), i == matchedWaypoints.size() - 2 ? nearbyTrack : null, refTracks[i]); //seg = searchTrack(matchedWaypoints.get(i), matchedWaypoints.get(i + 1), i == matchedWaypoints.size() - 2 ? nearbyTrack : null, refTracks[i]);
seg = searchTrack(matchedWaypoints.get(i), matchedWaypoints.get(i + 1), nearbyTrack, refTracks[i]);
wptIndex = i; wptIndex = i;
} }
if (seg == null) if (seg == null)
@ -1076,7 +1077,14 @@ public class RoutingEngine extends Thread {
track.nogoChecksums = routingContext.getNogoChecksums(); track.nogoChecksums = routingContext.getNogoChecksums();
track.profileTimestamp = routingContext.profileTimestamp; track.profileTimestamp = routingContext.profileTimestamp;
track.isDirty = isDirty; track.isDirty = isDirty;
if (foundRawTrack == null) {
foundRawTrack = track; foundRawTrack = track;
} else {
for (OsmPathElement n : track.nodes) {
foundRawTrack.nodes.add(n);
}
foundRawTrack.endPoint = endWp;
}
if (engineMode==BROUTER_ENGINEMODE_PREPARE_REROUTE) { if (engineMode==BROUTER_ENGINEMODE_PREPARE_REROUTE) {
return null; // rerouting prepared return null; // rerouting prepared
} }