Skip to content

Commit

Permalink
Merge pull request #931 from conveyal/conditional-foot-routing
Browse files Browse the repository at this point in the history
keepRoutingOnFoot only in transit access searches
  • Loading branch information
ansoncfit authored Feb 16, 2024
2 parents 12a1b7a + 2376c4e commit d12f763
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/com/conveyal/r5/analyst/TravelTimeComputer.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ public OneOriginResult computeTravelTimes() {
// The generalized cost calculations currently increment time and weight by the same amount.
sr.quantityToMinimize = StreetRouter.State.RoutingVariable.DURATION_SECONDS;
sr.route();
// Change to walking in order to reach transit stops in pedestrian-only areas like train stations.
// This implies you are dropped off or have a very easy parking spot for your vehicle.
// This kind of multi-stage search should also be used when building egress distance cost tables.
if (accessMode != StreetMode.WALK) {
sr.keepRoutingOnFoot();
}

if (request.hasTransit()) {
// Change to walking in order to reach transit stops in pedestrian-only areas like train stations.
// This implies you are dropped off or have a very easy parking spot for your vehicle.
// This kind of multi-stage search should also be used when building egress distance cost tables.
// Note that this can take up to twice as long as the initial car/bike search. Do it only when the
// walking is necessary, and when the radius of the car/bike search is limited, as for transit access.
if (accessMode != StreetMode.WALK) {
sr.keepRoutingOnFoot();
}
// Find access times to transit stops, keeping the minimum across all access street modes.
// Note that getReachedStops() returns the routing variable units, not necessarily seconds.
// TODO add logic here if linkedStops are specified in pickupDelay?
Expand Down

0 comments on commit d12f763

Please sign in to comment.