Revert "App: Rerouting"
This commit is contained in:
parent
1a0b38d375
commit
b9b629185a
4 changed files with 3 additions and 76 deletions
|
|
@ -285,7 +285,6 @@ public final class OsmTrack {
|
|||
}
|
||||
dis.close();
|
||||
} catch (Exception e) {
|
||||
t = null;
|
||||
if (debugInfo != null) {
|
||||
debugInfo.append("Error reading rawTrack: " + e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ import btools.mapaccess.OsmLink;
|
|||
import btools.mapaccess.OsmLinkHolder;
|
||||
import btools.mapaccess.OsmNode;
|
||||
import btools.mapaccess.OsmNodePairSet;
|
||||
import btools.util.CheapAngleMeter;
|
||||
import btools.util.CheapRuler;
|
||||
import btools.util.CompactLongMap;
|
||||
import btools.util.SortedHeap;
|
||||
import btools.util.StackSampler;
|
||||
|
|
@ -32,8 +30,6 @@ public class RoutingEngine extends Thread {
|
|||
public final static int BROUTER_ENGINEMODE_SEED = 1;
|
||||
public final static int BROUTER_ENGINEMODE_GETELEV = 2;
|
||||
|
||||
public final static int BROUTER_ENGINEMODE_PREPARE_REROUTE = 6;
|
||||
|
||||
private NodesCache nodesCache;
|
||||
private SortedHeap<OsmPath> openSet = new SortedHeap<>();
|
||||
private boolean finished = false;
|
||||
|
|
@ -162,7 +158,6 @@ public class RoutingEngine extends Thread {
|
|||
|
||||
switch (engineMode) {
|
||||
case BROUTER_ENGINEMODE_ROUTING:
|
||||
case BROUTER_ENGINEMODE_PREPARE_REROUTE:
|
||||
if (waypoints.size() < 2) {
|
||||
throw new IllegalArgumentException("we need two lat/lon points at least!");
|
||||
}
|
||||
|
|
@ -194,9 +189,6 @@ public class RoutingEngine extends Thread {
|
|||
ArrayList<String> messageList = new ArrayList<>();
|
||||
for (int i = 0; ; i++) {
|
||||
track = findTrack(refTracks, lastTracks);
|
||||
|
||||
if (engineMode==BROUTER_ENGINEMODE_PREPARE_REROUTE) break; // no output for rerouting prepare
|
||||
|
||||
track.message = "track-length = " + track.distance + " filtered ascend = " + track.ascend
|
||||
+ " plain-ascend = " + track.plainAscend + " cost=" + track.cost;
|
||||
if (track.energy != 0) {
|
||||
|
|
@ -583,10 +575,6 @@ public class RoutingEngine extends Thread {
|
|||
boolean dirty = found && nearbyTrack.isDirty;
|
||||
logInfo("read referenceTrack, found=" + found + " dirty=" + dirty + " " + debugInfo);
|
||||
}
|
||||
if (nearbyTrack != null &&
|
||||
engineMode==BROUTER_ENGINEMODE_PREPARE_REROUTE) {
|
||||
return null; // already rerouting prepared
|
||||
}
|
||||
}
|
||||
|
||||
if (matchedWaypoints == null) { // could exist from the previous alternative level
|
||||
|
|
@ -599,22 +587,6 @@ public class RoutingEngine extends Thread {
|
|||
matchedWaypoints.add(mwp);
|
||||
}
|
||||
matchWaypointsToNodes(matchedWaypoints);
|
||||
if (routingContext.startDirection != null) {
|
||||
// add a nogo not to turn back
|
||||
double angle = CheapAngleMeter.normalize(180 + routingContext.startDirection);
|
||||
int[] np = CheapRuler.destination(matchedWaypoints.get(0).crosspoint.ilon, matchedWaypoints.get(0).crosspoint.ilat, 10, angle);
|
||||
OsmNodeNamed n = new OsmNodeNamed();
|
||||
n.name = "nogo8";
|
||||
n.ilon = np[0];
|
||||
n.ilat = np[1];
|
||||
n.isNogo = true;
|
||||
n.radius = 8;
|
||||
n.nogoWeight = 9999;
|
||||
if (routingContext.nogopoints == null) {
|
||||
routingContext.nogopoints = new ArrayList<>();
|
||||
}
|
||||
routingContext.nogopoints.add(n);
|
||||
}
|
||||
|
||||
routingContext.checkMatchedWaypointAgainstNogos(matchedWaypoints);
|
||||
|
||||
|
|
@ -659,8 +631,7 @@ public class RoutingEngine extends Thread {
|
|||
routingContext.inverseDirection = false;
|
||||
wptIndex = i + 1;
|
||||
} 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), nearbyTrack, refTracks[i]);
|
||||
seg = searchTrack(matchedWaypoints.get(i), matchedWaypoints.get(i + 1), i == matchedWaypoints.size() - 2 ? nearbyTrack : null, refTracks[i]);
|
||||
wptIndex = i;
|
||||
}
|
||||
if (seg == null)
|
||||
|
|
@ -1077,18 +1048,7 @@ public class RoutingEngine extends Thread {
|
|||
track.nogoChecksums = routingContext.getNogoChecksums();
|
||||
track.profileTimestamp = routingContext.profileTimestamp;
|
||||
track.isDirty = isDirty;
|
||||
if (foundRawTrack == null) {
|
||||
foundRawTrack = track;
|
||||
} else {
|
||||
for (OsmPathElement n : track.nodes) {
|
||||
foundRawTrack.nodes.add(n);
|
||||
}
|
||||
foundRawTrack.endPoint = endWp;
|
||||
}
|
||||
if (engineMode==BROUTER_ENGINEMODE_PREPARE_REROUTE) {
|
||||
return null; // rerouting prepared
|
||||
}
|
||||
|
||||
foundRawTrack = track;
|
||||
}
|
||||
|
||||
if (!wasClean && isDirty) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue