Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
Browse files Browse the repository at this point in the history
…024-01-18
  • Loading branch information
leonardehrenfried committed Jan 18, 2024
2 parents 16e0736 + 86cffd6 commit 82be284
Show file tree
Hide file tree
Showing 63 changed files with 1,421 additions and 903 deletions.
2 changes: 2 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Add stop layer to new Debug UI [#5602](https://github.com/opentripplanner/OpenTripPlanner/pull/5602)
- Use fallback timezone if no transit data is loaded [#4652](https://github.com/opentripplanner/OpenTripPlanner/pull/4652)
- Add new path for GTFS GraphQL API, remove batch feature [#5581](https://github.com/opentripplanner/OpenTripPlanner/pull/5581)
- Restructure walk/bicycle/car preferences in router-config.json [#5582](https://github.com/opentripplanner/OpenTripPlanner/pull/5582)
- Revert REST API spelling change of real-time [#5629](https://github.com/opentripplanner/OpenTripPlanner/pull/5629)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
450 changes: 295 additions & 155 deletions docs/RouteRequest.md

Large diffs are not rendered by default.

65 changes: 44 additions & 21 deletions docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,34 +451,59 @@ Used to group requests when monitoring OTP.
]
},
"routingDefaults" : {
"walkSpeed" : 1.3,
"bikeSpeed" : 5,
"carSpeed" : 40,
"numItineraries" : 12,
"transferPenalty" : 0,
"walkReluctance" : 4.0,
"bikeReluctance" : 5.0,
"bikeWalkingReluctance" : 10.0,
"bikeStairsReluctance" : 150.0,
"carReluctance" : 10.0,
"stairsReluctance" : 1.65,
"turnReluctance" : 1.0,
"elevatorBoardTime" : 90,
"elevatorBoardCost" : 90,
"elevatorHopTime" : 20,
"elevatorHopCost" : 20,
"escalatorReluctance" : 1.5,
"vehicleRental" : {
"pickupCost" : 120,
"dropOffTime" : 30,
"dropOffCost" : 30
"bicycle" : {
"speed" : 5,
"reluctance" : 5.0,
"boardCost" : 600,
"walk" : {
"reluctance" : 10.0,
"stairsReluctance" : 150.0
},
"rental" : {
"pickupCost" : 120,
"dropOffTime" : "30s",
"dropOffCost" : 30
},
"parking" : {
"time" : "1m",
"cost" : 120
},
"triangle" : {
"safety" : 0.4,
"flatness" : 0.3,
"time" : 0.3
}
},
"car" : {
"speed" : 40,
"reluctance" : 10,
"decelerationSpeed" : 2.9,
"accelerationSpeed" : 2.9,
"rental" : {
"pickupCost" : 120,
"dropOffTime" : "30s",
"dropOffCost" : 30
},
"parking" : {
"time" : "5m",
"cost" : 600
}
},
"walk" : {
"speed" : 1.3,
"reluctance" : 4.0,
"stairsReluctance" : 1.65,
"boardCost" : 600,
"escalatorReluctance" : 1.5
},
"bikeParkTime" : "1m",
"bikeParkCost" : 120,
"carDropoffTime" : 120,
"waitReluctance" : 1.0,
"walkBoardCost" : 600,
"bikeBoardCost" : 600,
"otherThanPreferredRoutesPenalty" : 300,
"transferSlack" : 120,
"boardSlackForMode" : {
Expand Down Expand Up @@ -515,8 +540,6 @@ Used to group requests when monitoring OTP.
"minBikeParkingDistance" : 300,
"debug" : "limit-to-search-window"
},
"carDecelerationSpeed" : 2.9,
"carAccelerationSpeed" : 2.9,
"ignoreRealtimeUpdates" : false,
"geoidElevation" : false,
"maxJourneyDuration" : "36h",
Expand Down
54 changes: 34 additions & 20 deletions docs/examples/entur/router-config.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
{
"configVersion" : "{{ Entur CI config build number inserted here }}",
"routingDefaults": {
"walkSpeed": 1.3,
"bikeSpeed": 5,
"carSpeed": 40,
"numItineraries": 12,
"transferPenalty": 0,
"walkReluctance": 4.0,
"bikeReluctance": 5.0,
"bikeWalkingReluctance": 10.0,
"carReluctance": 10.0,
"stairsReluctance": 1.65,
"turnReluctance": 1.0,
"elevatorBoardTime": 90,
"elevatorBoardCost": 90,
"elevatorHopTime": 20,
"elevatorHopCost": 20,
"vehicleRental": {
"pickupCost": 120,
"dropOffTime": 30,
"dropOffCost": 30
"bicycle": {
"speed": 5,
"reluctance": 5.0,
"boardCost": 600,
"walk": {
"reluctance": 10.0
},
"rental": {
"pickupCost": 120,
"dropOffTime": "30s",
"dropOffCost": 30
},
"parking": {
"time": "1m",
"cost": 120
}
},
"car": {
"speed": 40,
"reluctance": 4.0,
"decelerationSpeed": 2.9,
"accelerationSpeed": 2.9,
"rental": {
"pickupCost": 120,
"dropOffTime": "30s",
"dropOffCost": 30
}
},
"walk": {
"speed": 1.3,
"reluctance": 4.0,
"stairsReluctance": 1.65,
"boardCost": 600
},
"bikeParkTime": "1m",
"bikeParkCost": 120,
"carDropoffTime": 120,
"waitReluctance": 1.0,
"walkBoardCost": 600,
"bikeBoardCost": 600,
"otherThanPreferredRoutesPenalty": 300,
"transferSlack": 120,
// Default slack for any mode is 0 (zero)
Expand All @@ -41,15 +57,13 @@
},
"accessEgress": {
"maxDurationForMode": {
"BIKE_RENTAL": "20m"
"BIKE_RENTAL": "20m"
}
},
"itineraryFilters" : {
"transitGeneralizedCostLimit" : "1h + 2.5 x",
"bikeRentalDistanceRatio": 0.3
},
"carDecelerationSpeed": 2.9,
"carAccelerationSpeed": 2.9,
"ignoreRealtimeUpdates": false,
"geoidElevation": false,
"maxJourneyDuration": "36h",
Expand Down
24 changes: 17 additions & 7 deletions docs/examples/ibi/atlanta/router-config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{
"routingDefaults": {
"bikeTriangleSafetyFactor": 0.4,
"bikeTriangleSlopeFactor": 0.3,
"bikeTriangleTimeFactor": 0.3,
"bicycle": {
"triangle": {
"time": 0.3,
"flatness": 0.3,
"safety": 0.4
},
"rental": {
"pickupTime": "3m",
"pickupCost": 850
}
},
"car": {
"rental": {
"pickupTime": "3m",
"pickupCost": 850
}
},
"itineraryFilters": {
// only show non-transit (ie. walking) when it's at least as good as the transit option
"nonTransitGeneralizedCostLimit": "0 + 1.0 x",
// add IBI accessibility score between 0 and 1
"accessibilityScore": true
},
"vehicleRental": {
"pickupTime": 180,
"pickupCost": 850
},
// use stop and trip with unknown wheelchair accessibility during routing
"wheelchairAccessibility": {
"trip": {
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/ibi/portland/router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"alightSlack": "0s",
"transferSlack": 180,
"waitReluctance": 0.9,
"walkReluctance": 1.75,
"stairsReluctance": 1.65,
"walk": {
"reluctance": 1.75,
"stairsReluctance": 1.65
},
"numItineraries": 3,
"geoidElevation": true,
"streetRoutingTimeout": "7s"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/skanetrafiken/router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
},
"transferSlack": 180,
"waitReluctance": 0.175,
"walkReluctance": 5,
"walk": {
"reluctance": 5
},
"maxDirectStreetDuration": "3700s"
},
"transit": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


<properties>
<otp.serialization.version.id>136</otp.serialization.version.id>
<otp.serialization.version.id>137</otp.serialization.version.id>
<!-- Lib versions - keep list sorted on property name -->
<geotools.version>30.1</geotools.version>
<google.dagger.version>2.50</google.dagger.version>
Expand Down
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;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public static ApiTripTimeShort mapToApi(TripTimeOnDate domain) {
api.stopCount = domain.getStopCount();
api.scheduledArrival = domain.getScheduledArrival();
api.scheduledDeparture = domain.getScheduledDeparture();
api.realTimeArrival = domain.getRealtimeArrival();
api.realTimeDeparture = domain.getRealtimeDeparture();
api.realimeArrival = domain.getRealtimeArrival();
api.realtimeDeparture = domain.getRealtimeDeparture();
api.arrivalDelay = domain.getArrivalDelay();
api.departureDelay = domain.getDepartureDelay();
api.timepoint = domain.isTimepoint();
api.realTime = domain.isRealtime();
api.realTimeState = ApiRealTimeState.RealTimeState(domain.getRealTimeState());
api.realtime = domain.isRealtime();
api.realtimeState = ApiRealTimeState.RealTimeState(domain.getRealTimeState());
api.blockId = domain.getBlockId();
api.headsign = I18NStringMapper.mapToApi(domain.getHeadsign(), null);
api.tripId = FeedScopedIdMapper.mapToApi(domain.getTrip().getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public class ApiTripTimeShort implements Serializable {
public int stopCount;
public int scheduledArrival = UNDEFINED;
public int scheduledDeparture = UNDEFINED;
public int realTimeArrival = UNDEFINED;
public int realTimeDeparture = UNDEFINED;
public int realimeArrival = UNDEFINED;
public int realtimeDeparture = UNDEFINED;
public int arrivalDelay = UNDEFINED;
public int departureDelay = UNDEFINED;
public boolean timepoint = false;
public boolean realTime = false;
public ApiRealTimeState realTimeState = ApiRealTimeState.SCHEDULED;
public boolean realtime = false;
public ApiRealTimeState realtimeState = ApiRealTimeState.SCHEDULED;
public long serviceDay;
public String tripId;
public String blockId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class ApiVehicleParkingWithEntrance {
/**
* True if real-time information is used for checking availability.
*/
public final boolean realTime;
public final boolean realtime;

ApiVehicleParkingWithEntrance(
String id,
Expand Down Expand Up @@ -114,7 +114,7 @@ public class ApiVehicleParkingWithEntrance {
this.hasWheelchairAccessibleCarPlaces = hasWheelchairAccessibleCarPlaces;
this.capacity = capacity;
this.availability = availability;
this.realTime = realTime;
this.realtime = realTime;
}

public static ApiVehicleParkingWithEntranceBuilder builder() {
Expand Down
Loading

0 comments on commit 82be284

Please sign in to comment.