-
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 #5582 from HSLdevcom/route-request-refactor
Restructure walk/bicycle/car preferences in router-config.json
- Loading branch information
Showing
57 changed files
with
1,406 additions
and
890 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
src/ext/java/org/opentripplanner/ext/restapi/mapping/LegacyBicycleOptimizeType.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,24 @@ | ||
package org.opentripplanner.ext.restapi.mapping; | ||
|
||
import org.opentripplanner.routing.core.BicycleOptimizeType; | ||
|
||
/** | ||
* Bicycle optimization types that are only meant to be used by the REST API. Related to {@link org.opentripplanner.routing.core.BicycleOptimizeType} | ||
*/ | ||
public enum LegacyBicycleOptimizeType { | ||
QUICK, | ||
SAFE, | ||
FLAT, | ||
GREENWAYS, | ||
TRIANGLE; | ||
|
||
public static BicycleOptimizeType map(LegacyBicycleOptimizeType type) { | ||
return switch (type) { | ||
case QUICK -> BicycleOptimizeType.SHORTEST_DURATION; | ||
case FLAT -> BicycleOptimizeType.FLAT_STREETS; | ||
case SAFE -> BicycleOptimizeType.SAFE_STREETS; | ||
case GREENWAYS -> BicycleOptimizeType.SAFEST_STREETS; | ||
case TRIANGLE -> BicycleOptimizeType.TRIANGLE; | ||
}; | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/main/java/org/opentripplanner/apis/gtfs/mapping/OptimizationTypeMapper.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,19 @@ | ||
package org.opentripplanner.apis.gtfs.mapping; | ||
|
||
import javax.annotation.Nonnull; | ||
import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; | ||
import org.opentripplanner.routing.core.BicycleOptimizeType; | ||
|
||
public final class OptimizationTypeMapper { | ||
|
||
@Nonnull | ||
public static BicycleOptimizeType map(GraphQLTypes.GraphQLOptimizeType optimizeType) { | ||
return switch (optimizeType) { | ||
case QUICK -> BicycleOptimizeType.SHORTEST_DURATION; | ||
case FLAT -> BicycleOptimizeType.FLAT_STREETS; | ||
case SAFE -> BicycleOptimizeType.SAFE_STREETS; | ||
case GREENWAYS -> BicycleOptimizeType.SAFEST_STREETS; | ||
case TRIANGLE -> BicycleOptimizeType.TRIANGLE; | ||
}; | ||
} | ||
} |
Oops, something went wrong.