-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6293 from HSLdevcom/split-transfers-by-mode-patht…
…ransfer-mode Enable mode-specific transfers by storing mode information in transfers
- Loading branch information
Showing
15 changed files
with
231 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...org/opentripplanner/routing/algorithm/mapping/StreetModeToTransferTraverseModeMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.opentripplanner.routing.algorithm.mapping; | ||
|
||
import org.opentripplanner.routing.api.request.StreetMode; | ||
import org.opentripplanner.street.search.TraverseMode; | ||
|
||
/** | ||
* Maps street mode to transfer traverse mode. | ||
*/ | ||
public class StreetModeToTransferTraverseModeMapper { | ||
|
||
public static TraverseMode map(StreetMode mode) { | ||
return switch (mode) { | ||
case WALK -> TraverseMode.WALK; | ||
case BIKE -> TraverseMode.BICYCLE; | ||
case CAR -> TraverseMode.CAR; | ||
default -> throw new IllegalArgumentException( | ||
String.format("StreetMode %s can not be mapped to a TraverseMode for transfers.", mode) | ||
); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.