enabled via pts for dynamic range
This commit is contained in:
parent
0d28726ec9
commit
57726a36ce
@ -982,9 +982,10 @@ public class RoutingEngine extends Thread {
|
||||
resetCache(false);
|
||||
range = -range;
|
||||
List<MatchedWaypoint> tmp = new ArrayList<>();
|
||||
// only first or last checked
|
||||
if (unmatchedWaypoints.get(0).crosspoint == null) tmp.add(unmatchedWaypoints.get(0));
|
||||
if (unmatchedWaypoints.get(unmatchedWaypoints.size()-1).crosspoint == null) tmp.add(unmatchedWaypoints.get(unmatchedWaypoints.size()-1));
|
||||
// only w/o crosspoint check
|
||||
for (MatchedWaypoint mwp: unmatchedWaypoints) {
|
||||
if (mwp.crosspoint == null) tmp.add(mwp);
|
||||
}
|
||||
|
||||
ok = nodesCache.matchWaypointsToNodes(tmp, range, islandNodePairs);
|
||||
}
|
||||
@ -1012,11 +1013,23 @@ public class RoutingEngine extends Thread {
|
||||
nmw.direct = true;
|
||||
wp.crosspoint = new OsmNode(wp.waypoint.ilon, wp.waypoint.ilat);
|
||||
}
|
||||
nmw.name = wp.name;
|
||||
nmw.name = wp.name + "_1";
|
||||
waypoints.add(nmw);
|
||||
wp.name = wp.name + "_add";
|
||||
waypoints.add(wp);
|
||||
if (wp.name.startsWith("via")) {
|
||||
wp.direct = true;
|
||||
MatchedWaypoint emw = new MatchedWaypoint();
|
||||
emw.waypoint = new OsmNode(nmw.crosspoint.ilon, nmw.crosspoint.ilat);
|
||||
emw.crosspoint = new OsmNode(nmw.crosspoint.ilon, nmw.crosspoint.ilat);
|
||||
emw.node1 = new OsmNode(nmw.node1.ilon, nmw.node1.ilat);
|
||||
emw.node2 = new OsmNode(nmw.node2.ilon, nmw.node2.ilat);
|
||||
emw.direct = false;
|
||||
emw.name = wp.name + "_2";
|
||||
waypoints.add(emw);
|
||||
}
|
||||
} else {
|
||||
waypoints.add(wp);
|
||||
}
|
||||
waypoints.add(wp);
|
||||
}
|
||||
unmatchedWaypoints.clear();
|
||||
unmatchedWaypoints.addAll(waypoints);
|
||||
|
||||
@ -113,7 +113,7 @@ public final class WaypointMatcherImpl implements WaypointMatcher {
|
||||
double r22 = x2 * x2 + y2 * y2;
|
||||
double radius = Math.abs(r12 < r22 ? y1 * dx - x1 * dy : y2 * dx - x2 * dy) / d;
|
||||
|
||||
if (radius <= mwp.radius || (this.useDynamicRange && (i == 0 || i == maxWptIdx))) {
|
||||
if (radius <= mwp.radius || this.useDynamicRange) {
|
||||
double s1 = x1 * dx + y1 * dy;
|
||||
double s2 = x2 * dx + y2 * dy;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user