hardcoded waypoint distance to variable

This commit is contained in:
afischerdev 2021-07-30 14:15:12 +02:00
parent 1886ef1f17
commit 8e008a8d66
3 changed files with 5 additions and 2 deletions

View file

@ -79,6 +79,7 @@ public final class RoutingContext
public double starttimeoffset; public double starttimeoffset;
public boolean transitonly; public boolean transitonly;
public double waypointCatchingRange;
private void setModel( String className ) private void setModel( String className )
{ {
@ -144,6 +145,8 @@ public final class RoutingContext
bikeMode = 0.f != expctxGlobal.getVariableValue( "validForBikes", 0.f ); bikeMode = 0.f != expctxGlobal.getVariableValue( "validForBikes", 0.f );
footMode = 0.f != expctxGlobal.getVariableValue( "validForFoot", 0.f ); footMode = 0.f != expctxGlobal.getVariableValue( "validForFoot", 0.f );
waypointCatchingRange = expctxGlobal.getVariableValue( "waypointCatchingRange", 250.f );
// turn-restrictions used per default for car profiles // turn-restrictions used per default for car profiles
considerTurnRestrictions = 0.f != expctxGlobal.getVariableValue( "considerTurnRestrictions", carMode ? 1.f : 0.f ); considerTurnRestrictions = 0.f != expctxGlobal.getVariableValue( "considerTurnRestrictions", carMode ? 1.f : 0.f );

View file

@ -452,7 +452,7 @@ public class RoutingEngine extends Thread
private void matchWaypointsToNodes( List<MatchedWaypoint> unmatchedWaypoints ) private void matchWaypointsToNodes( List<MatchedWaypoint> unmatchedWaypoints )
{ {
resetCache( false ); resetCache( false );
nodesCache.matchWaypointsToNodes( unmatchedWaypoints, 250., islandNodePairs ); nodesCache.matchWaypointsToNodes( unmatchedWaypoints, routingContext.waypointCatchingRange, islandNodePairs );
} }
private OsmTrack searchTrack( MatchedWaypoint startWp, MatchedWaypoint endWp, OsmTrack nearbyTrack, OsmTrack refTrack ) private OsmTrack searchTrack( MatchedWaypoint startWp, MatchedWaypoint endWp, OsmTrack nearbyTrack, OsmTrack refTrack )

View file

@ -338,7 +338,7 @@ public final class NodesCache
public void matchWaypointsToNodes( List<MatchedWaypoint> unmatchedWaypoints, double maxDistance, OsmNodePairSet islandNodePairs ) public void matchWaypointsToNodes( List<MatchedWaypoint> unmatchedWaypoints, double maxDistance, OsmNodePairSet islandNodePairs )
{ {
waypointMatcher = new WaypointMatcherImpl( unmatchedWaypoints, 250., islandNodePairs ); waypointMatcher = new WaypointMatcherImpl( unmatchedWaypoints, maxDistance, islandNodePairs );
for( MatchedWaypoint mwp : unmatchedWaypoints ) for( MatchedWaypoint mwp : unmatchedWaypoints )
{ {
preloadPosition( mwp.waypoint ); preloadPosition( mwp.waypoint );