From c5184b2ad2df34461d5f1412e4272f97b5707e20 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 8 Nov 2024 11:38:04 +0100 Subject: [PATCH 01/55] Move parking service out of the Graph --- .../ext/parkAndRideApi/ParkAndRideResource.java | 2 +- .../ext/restapi/model/ApiRouterInfo.java | 5 ++--- .../ext/restapi/model/ApiTravelOptionsMaker.java | 7 ++++--- .../ext/restapi/resources/Routers.java | 1 + .../ext/vectortiles/VectorTilesResource.java | 4 ++-- .../VehicleParkingGroupsLayerBuilder.java | 11 +++++------ .../VehicleParkingsLayerBuilder.java | 11 +++++------ .../apis/gtfs/GraphQLRequestContext.java | 2 +- .../apis/transmodel/support/GqlUtil.java | 1 - .../graph_builder/module/StreetLinkerModule.java | 8 +++++--- .../graph_builder/module/osm/OsmModule.java | 14 +++++++++----- .../graph_builder/module/osm/OsmModuleBuilder.java | 5 ++++- .../org/opentripplanner/netex/NetexModule.java | 6 +++++- .../org/opentripplanner/routing/graph/Graph.java | 6 ------ .../standalone/api/OtpServerRequestContext.java | 4 ++++ 15 files changed, 48 insertions(+), 39 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java index 6529fc4234d..ec1ac7348d7 100644 --- a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java @@ -36,7 +36,7 @@ public ParkAndRideResource( */ @Deprecated @PathParam("ignoreRouterId") String ignoreRouterId ) { - this.vehicleParkingService = serverContext.graph().getVehicleParkingService(); + this.vehicleParkingService = serverContext.getVehicleParkingService(); // TODO OTP2 - Why are we using the DirectGraphFinder here, not just // - serverContext.graphFinder(). This needs at least a comment! diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java index a0bbb1116b3..aa072cfaed0 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java @@ -34,10 +34,9 @@ public ApiRouterInfo( Graph graph, TransitService transitService, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, WorldEnvelope envelope ) { - VehicleParkingService vehicleParkingService = graph.getVehicleParkingService(); - this.routerId = routerId; this.polygon = graph.getConvexHull(); this.buildTime = Date.from(graph.buildTime); @@ -51,7 +50,7 @@ public ApiRouterInfo( this.hasParkRide = this.hasCarPark; this.hasVehicleParking = mapHasVehicleParking(vehicleParkingService); this.travelOptions = - ApiTravelOptionsMaker.makeOptions(graph, vehicleRentalService, transitService); + ApiTravelOptionsMaker.makeOptions(graph, vehicleRentalService, vehicleParkingService, transitService); } public boolean mapHasBikeSharing(VehicleRentalService service) { diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java index cf424392d70..40302032d4f 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java @@ -5,6 +5,7 @@ import java.util.Set; import org.opentripplanner.api.parameter.ApiRequestMode; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.service.TransitService; @@ -29,14 +30,14 @@ public final class ApiTravelOptionsMaker { public static List makeOptions( Graph graph, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, TransitService transitService ) { - var service = graph.getVehicleParkingService(); return makeOptions( transitService.getTransitModes(), vehicleRentalService.hasRentalBikes(), - service.hasBikeParking(), - service.hasCarParking() + vehicleParkingService.hasBikeParking(), + vehicleParkingService.hasCarParking() ); } diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java index 9cfab49017c..d5dae967568 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java @@ -66,6 +66,7 @@ private ApiRouterInfo getRouterInfo() { serverContext.graph(), serverContext.transitService(), serverContext.vehicleRentalService(), + serverContext.getVehicleParkingService(), serverContext.worldEnvelopeService().envelope().orElseThrow() ); } catch (GraphNotFoundException e) { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java index 29701ee2307..ada19316866 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java @@ -140,12 +140,12 @@ private static LayerBuilder createLayerBuilder( layerParameters ); case VehicleParking -> new VehicleParkingsLayerBuilder( - context.graph(), + context.getVehicleParkingService(), layerParameters, locale ); case VehicleParkingGroup -> new VehicleParkingGroupsLayerBuilder( - context.graph(), + context.getVehicleParkingService(), layerParameters, locale ); diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java index 0cd1d84868b..a33cada7465 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java @@ -13,7 +13,7 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.inspector.vector.LayerBuilder; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; public class VehicleParkingGroupsLayerBuilder extends LayerBuilder { @@ -21,10 +21,10 @@ public class VehicleParkingGroupsLayerBuilder extends LayerBuilder layerParameters, Locale locale ) { @@ -33,13 +33,12 @@ public VehicleParkingGroupsLayerBuilder( layerParameters.name(), layerParameters.expansionFactor() ); - this.graph = graph; + this.service = service; } @Override protected List getGeometries(Envelope query) { - return graph - .getVehicleParkingService() + return service .getVehicleParkingGroups() .asMap() .entrySet() diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java index 95326172415..49e081d0039 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java @@ -16,8 +16,8 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.inspector.vector.LayerBuilder; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; public class VehicleParkingsLayerBuilder extends LayerBuilder { @@ -28,10 +28,10 @@ public class VehicleParkingsLayerBuilder extends LayerBuilder { ), entry(MapperType.Digitransit, DigitransitVehicleParkingPropertyMapper::create) ); - private final Graph graph; + private final VehicleParkingService service; public VehicleParkingsLayerBuilder( - Graph graph, + VehicleParkingService service, LayerParameters layerParameters, Locale locale ) { @@ -40,13 +40,12 @@ public VehicleParkingsLayerBuilder( layerParameters.name(), layerParameters.expansionFactor() ); - this.graph = graph; + this.service = service; } @Override protected List getGeometries(Envelope query) { - return graph - .getVehicleParkingService() + return service .getVehicleParkings() .map(vehicleParking -> { Coordinate coordinate = vehicleParking.getCoordinate().asJtsCoordinate(); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java index 192cbb26aa9..084a1e2dfc9 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java @@ -25,7 +25,7 @@ public static GraphQLRequestContext ofServerContext(OtpServerRequestContext cont context.routingService(), context.transitService(), context.graph().getFareService(), - context.graph().getVehicleParkingService(), + context.getVehicleParkingService(), context.vehicleRentalService(), context.realtimeVehicleService(), context.graphFinder(), diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java index 6b9abc75b05..a9f5414683b 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java @@ -38,7 +38,6 @@ public static VehicleParkingService getVehicleParkingService( DataFetchingEnvironment environment ) { return ((TransmodelRequestContext) environment.getContext()).getServerContext() - .graph() .getVehicleParkingService(); } diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 98b2287542e..1a299aa9141 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -13,6 +13,7 @@ import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetStationCentroidLink; import org.opentripplanner.street.model.edge.StreetTransitEntranceLink; @@ -27,7 +28,6 @@ import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.street.search.TraverseModeSet; -import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.site.GroupStop; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; @@ -49,17 +49,20 @@ public class StreetLinkerModule implements GraphBuilderModule { private static final TraverseModeSet CAR_ONLY = new TraverseModeSet(TraverseMode.CAR); private static final TraverseModeSet WALK_ONLY = new TraverseModeSet(TraverseMode.WALK); private final Graph graph; + private final VehicleParkingService parkingService; private final TimetableRepository timetableRepository; private final DataImportIssueStore issueStore; private final Boolean addExtraEdgesToAreas; public StreetLinkerModule( Graph graph, + VehicleParkingService parkingService, TimetableRepository timetableRepository, DataImportIssueStore issueStore, boolean addExtraEdgesToAreas ) { this.graph = graph; + this.parkingService = parkingService; this.timetableRepository = timetableRepository; this.issueStore = issueStore; this.addExtraEdgesToAreas = addExtraEdgesToAreas; @@ -311,8 +314,7 @@ private void linkVehicleParks(Graph graph, DataImportIssueStore issueStore) { } } if (!vehicleParkingToRemove.isEmpty()) { - var vehicleParkingService = graph.getVehicleParkingService(); - vehicleParkingService.updateVehicleParking(List.of(), vehicleParkingToRemove); + parkingService.updateVehicleParking(List.of(), vehicleParkingToRemove); } } diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index 08d23087a45..3e338b0cfb8 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -26,6 +26,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.util.ElevationUtils; import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.edge.StreetEdge; @@ -51,6 +52,7 @@ public class OsmModule implements GraphBuilderModule { */ private final List providers; private final Graph graph; + private final VehicleParkingService parkingService; private final DataImportIssueStore issueStore; private final OsmProcessingParameters params; private final SafetyValueNormalizer normalizer; @@ -61,6 +63,7 @@ public class OsmModule implements GraphBuilderModule { OsmModule( Collection providers, Graph graph, + VehicleParkingService parkingService, DataImportIssueStore issueStore, StreetLimitationParameters streetLimitationParameters, OsmProcessingParameters params @@ -73,14 +76,15 @@ public class OsmModule implements GraphBuilderModule { this.vertexGenerator = new VertexGenerator(osmdb, graph, params.boardingAreaRefTags()); this.normalizer = new SafetyValueNormalizer(graph, issueStore); this.streetLimitationParameters = Objects.requireNonNull(streetLimitationParameters); + this.parkingService = parkingService; } - public static OsmModuleBuilder of(Collection providers, Graph graph) { - return new OsmModuleBuilder(providers, graph); + public static OsmModuleBuilder of(Collection providers, Graph graph, VehicleParkingService service) { + return new OsmModuleBuilder(providers, graph, service); } - public static OsmModuleBuilder of(OsmProvider provider, Graph graph) { - return of(List.of(provider), graph); + public static OsmModuleBuilder of(OsmProvider provider, Graph graph, VehicleParkingService service) { + return of(List.of(provider), graph, service); } @Override @@ -163,7 +167,7 @@ private void build() { } if (!parkingLots.isEmpty()) { - graph.getVehicleParkingService().updateVehicleParking(parkingLots, List.of()); + parkingService.updateVehicleParking(parkingLots, List.of()); } var elevatorProcessor = new ElevatorProcessor(issueStore, osmdb, vertexGenerator); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java index 6e90fb20b1c..4c80f3db795 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java @@ -8,6 +8,7 @@ import org.opentripplanner.graph_builder.services.osm.EdgeNamer; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.StreetLimitationParameters; /** @@ -17,6 +18,7 @@ public class OsmModuleBuilder { private final Collection providers; private final Graph graph; + private final VehicleParkingService parkingService; private Set boardingAreaRefTags = Set.of(); private DataImportIssueStore issueStore = DataImportIssueStore.NOOP; private EdgeNamer edgeNamer = new DefaultNamer(); @@ -27,9 +29,10 @@ public class OsmModuleBuilder { private int maxAreaNodes; private StreetLimitationParameters streetLimitationParameters = new StreetLimitationParameters(); - OsmModuleBuilder(Collection providers, Graph graph) { + OsmModuleBuilder(Collection providers, Graph graph, VehicleParkingService parkingService) { this.providers = providers; this.graph = graph; + this.parkingService = parkingService; } public OsmModuleBuilder withBoardingAreaRefTags(Set boardingAreaRefTags) { diff --git a/application/src/main/java/org/opentripplanner/netex/NetexModule.java b/application/src/main/java/org/opentripplanner/netex/NetexModule.java index 4c45131389f..199b05f626b 100644 --- a/application/src/main/java/org/opentripplanner/netex/NetexModule.java +++ b/application/src/main/java/org/opentripplanner/netex/NetexModule.java @@ -14,6 +14,7 @@ import org.opentripplanner.model.impl.OtpTransitServiceBuilder; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; @@ -29,6 +30,7 @@ public class NetexModule implements GraphBuilderModule { private final Graph graph; private final TimetableRepository timetableRepository; + private final VehicleParkingService parkingService; private final DataImportIssueStore issueStore; /** @@ -42,6 +44,7 @@ public class NetexModule implements GraphBuilderModule { public NetexModule( Graph graph, TimetableRepository timetableRepository, + VehicleParkingService parkingService, DataImportIssueStore issueStore, int subwayAccessTime, ServiceDateInterval transitPeriodLimit, @@ -49,6 +52,7 @@ public NetexModule( ) { this.graph = graph; this.timetableRepository = timetableRepository; + this.parkingService = parkingService; this.issueStore = issueStore; this.subwayAccessTime = subwayAccessTime; this.transitPeriodLimit = transitPeriodLimit; @@ -103,7 +107,7 @@ public void buildGraph() { timetableRepository.validateTimeZones(); var lots = transitBuilder.vehicleParkings(); - graph.getVehicleParkingService().updateVehicleParking(lots, List.of()); + parkingService.updateVehicleParking(lots, List.of()); var linker = new VehicleParkingHelper(graph); lots.forEach(linker::linkVehicleParkingToGraph); } diff --git a/application/src/main/java/org/opentripplanner/routing/graph/Graph.java b/application/src/main/java/org/opentripplanner/routing/graph/Graph.java index 04266476ae5..70ce563700c 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/Graph.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/Graph.java @@ -22,7 +22,6 @@ import org.opentripplanner.routing.graph.index.StreetIndex; import org.opentripplanner.routing.linking.VertexLinker; import org.opentripplanner.routing.services.notes.StreetNotesService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.vertex.TransitStopVertex; @@ -111,7 +110,6 @@ public class Graph implements Serializable { // static variable in CompactElevationProfile in SerializedGraphObject private double distanceBetweenElevationSamples; - private final VehicleParkingService vehicleParkingService = new VehicleParkingService(); private FareService fareService; /** @@ -362,10 +360,6 @@ public void setDistanceBetweenElevationSamples(double distanceBetweenElevationSa CompactElevationProfile.setDistanceBetweenSamplesM(distanceBetweenElevationSamples); } - public VehicleParkingService getVehicleParkingService() { - return vehicleParkingService; - } - public FareService getFareService() { return fareService; } diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index 49b43856011..14b5d1e04e2 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -22,6 +22,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; @@ -96,6 +97,8 @@ public interface OtpServerRequestContext { VehicleRentalService vehicleRentalService(); + VehicleParkingService getVehicleParkingService(); + TransitTuningParameters transitTuningParameters(); RaptorTuningParameters raptorTuningParameters(); @@ -147,4 +150,5 @@ default DataOverlayContext dataOverlayContext(RouteRequest request) { @Nullable SorlandsbanenNorwayService sorlandsbanenService(); + } From cdb5ea1e981728e0516a536cd1c3384af85571e7 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 8 Nov 2024 12:55:49 +0100 Subject: [PATCH 02/55] Update wiring of parking service --- .../VehicleParkingGroupsLayerTest.java | 10 +++--- .../VehicleParkingsLayerTest.java | 6 ++-- .../module/configure/GraphBuilderFactory.java | 4 +++ .../module/configure/GraphBuilderModules.java | 24 ++++++++++++-- .../graph_builder/module/osm/OsmModule.java | 12 +++++-- .../module/osm/OsmModuleBuilder.java | 7 +++- .../netex/configure/NetexConfigure.java | 3 ++ .../api/OtpServerRequestContext.java | 1 - .../configure/ConstructApplication.java | 6 ++++ .../ConstructApplicationFactory.java | 5 +++ .../configure/ConstructApplicationModule.java | 3 ++ .../server/DefaultServerRequestContext.java | 11 +++++++ .../configure/UpdaterConfigurator.java | 19 +++++------ .../opentripplanner/ConstantsForTests.java | 16 +++++++--- .../opentripplanner/TestServerContext.java | 6 ++++ .../apis/gtfs/GraphQLIntegrationTest.java | 28 ++++++++-------- .../LegacyRouteRequestMapperTest.java | 3 +- .../routerequest/RouteRequestMapperTest.java | 3 +- .../mapping/TripRequestMapperTest.java | 2 ++ .../OsmBoardingLocationsModuleTest.java | 3 +- .../module/StreetLinkerModuleTest.java | 10 +++++- .../module/TestStreetLinkerModule.java | 10 +++++- .../module/VehicleParkingLinkingTest.java | 3 +- .../islandpruning/IslandPruningUtils.java | 6 +++- .../module/linking/LinkingTest.java | 3 +- .../module/osm/OsmModuleTest.java | 32 +++++++++++++------ .../module/osm/PlatformLinkerTest.java | 6 +++- .../module/osm/TriangleInequalityTest.java | 6 +++- .../module/osm/UnconnectedAreasTest.java | 3 +- .../module/osm/UnroutableTest.java | 6 +++- .../transit/speed_test/SpeedTest.java | 3 ++ .../VehicleParkingUpdaterTest.java | 25 +++++---------- 32 files changed, 200 insertions(+), 85 deletions(-) diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java index 95ad7ea713e..bd0f2b8c37a 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java @@ -19,7 +19,6 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; @@ -90,8 +89,7 @@ public void setUp() { @Test public void vehicleParkingGroupGeometryTest() { - Graph graph = new Graph(); - VehicleParkingService service = graph.getVehicleParkingService(); + VehicleParkingService service = new VehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = @@ -116,7 +114,7 @@ public void vehicleParkingGroupGeometryTest() { var tiles = VectorTileConfig.mapVectorTilesParameters(nodeAdapter, "vectorTiles"); assertEquals(1, tiles.layers().size()); var builder = new VehicleParkingGroupsLayerBuilderWithPublicGeometry( - graph, + service, tiles.layers().get(0), Locale.US ); @@ -171,11 +169,11 @@ private static class VehicleParkingGroupsLayerBuilderWithPublicGeometry extends VehicleParkingGroupsLayerBuilder { public VehicleParkingGroupsLayerBuilderWithPublicGeometry( - Graph graph, + VehicleParkingService service, LayerParameters layerParameters, Locale locale ) { - super(graph, layerParameters, locale); + super(service, layerParameters, locale); } @Override diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java index b63c9c51bc6..376486c5e8b 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java @@ -23,7 +23,6 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; @@ -86,8 +85,7 @@ public void setUp() { @Test public void vehicleParkingGeometryTest() { - Graph graph = new Graph(); - VehicleParkingService service = graph.getVehicleParkingService(); + VehicleParkingService service = new VehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = @@ -111,7 +109,7 @@ public void vehicleParkingGeometryTest() { var nodeAdapter = newNodeAdapterForTest(config); var tiles = VectorTileConfig.mapVectorTilesParameters(nodeAdapter, "vectorTiles"); assertEquals(1, tiles.layers().size()); - var builder = new VehicleParkingsLayerBuilder(graph, tiles.layers().getFirst(), Locale.US); + var builder = new VehicleParkingsLayerBuilder(service, tiles.layers().getFirst(), Locale.US); List geometries = builder.getGeometries(new Envelope(0.99, 1.01, 1.99, 2.01)); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java index d0d359cea3e..da7ce85b647 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java @@ -30,6 +30,7 @@ import org.opentripplanner.gtfs.graphbuilder.GtfsModule; import org.opentripplanner.netex.NetexModule; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; @@ -87,6 +88,9 @@ Builder stopConsolidationRepository( @Nullable StopConsolidationRepository stopConsolidationRepository ); + @BindsInstance + Builder vehicleParkingService(VehicleParkingService parkingService); + @BindsInstance Builder streetLimitationParameters(StreetLimitationParameters streetLimitationParameters); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java index 080d69c571e..cb063129b68 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java @@ -43,6 +43,7 @@ import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.api.request.preference.WalkPreferences; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.transit.service.TimetableRepository; @@ -59,6 +60,7 @@ static OsmModule provideOsmModule( GraphBuilderDataSources dataSources, BuildConfig config, Graph graph, + VehicleParkingService parkingService, DataImportIssueStore issueStore, StreetLimitationParameters streetLimitationParameters ) { @@ -76,7 +78,7 @@ static OsmModule provideOsmModule( } return OsmModule - .of(providers, graph) + .of(providers, graph, parkingService) .withEdgeNamer(config.edgeNamer) .withAreaVisibility(config.areaVisibility) .withPlatformEntriesLinking(config.platformEntriesLinking) @@ -139,12 +141,14 @@ static NetexModule provideNetexModule( BuildConfig config, Graph graph, TimetableRepository timetableRepository, + VehicleParkingService parkingService, DataImportIssueStore issueStore ) { return new NetexConfigure(config) .createNetexModule( dataSources.getNetexConfiguredDatasource(), timetableRepository, + parkingService, graph, issueStore ); @@ -155,10 +159,17 @@ static NetexModule provideNetexModule( static StreetLinkerModule provideStreetLinkerModule( BuildConfig config, Graph graph, + VehicleParkingService parkingService, TimetableRepository timetableRepository, DataImportIssueStore issueStore ) { - return new StreetLinkerModule(graph, timetableRepository, issueStore, config.areaVisibility); + return new StreetLinkerModule( + graph, + parkingService, + timetableRepository, + issueStore, + config.areaVisibility + ); } @Provides @@ -166,6 +177,7 @@ static StreetLinkerModule provideStreetLinkerModule( static PruneIslands providePruneIslands( BuildConfig config, Graph graph, + VehicleParkingService parkingService, TimetableRepository timetableRepository, DataImportIssueStore issueStore ) { @@ -173,7 +185,13 @@ static PruneIslands providePruneIslands( graph, timetableRepository, issueStore, - new StreetLinkerModule(graph, timetableRepository, issueStore, config.areaVisibility) + new StreetLinkerModule( + graph, + parkingService, + timetableRepository, + issueStore, + config.areaVisibility + ) ); pruneIslands.setPruningThresholdIslandWithoutStops( config.islandPruning.pruningThresholdIslandWithoutStops diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index 3e338b0cfb8..64f8a4ec4b3 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -79,11 +79,19 @@ public class OsmModule implements GraphBuilderModule { this.parkingService = parkingService; } - public static OsmModuleBuilder of(Collection providers, Graph graph, VehicleParkingService service) { + public static OsmModuleBuilder of( + Collection providers, + Graph graph, + VehicleParkingService service + ) { return new OsmModuleBuilder(providers, graph, service); } - public static OsmModuleBuilder of(OsmProvider provider, Graph graph, VehicleParkingService service) { + public static OsmModuleBuilder of( + OsmProvider provider, + Graph graph, + VehicleParkingService service + ) { return of(List.of(provider), graph, service); } diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java index 4c80f3db795..aa97408ba66 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java @@ -29,7 +29,11 @@ public class OsmModuleBuilder { private int maxAreaNodes; private StreetLimitationParameters streetLimitationParameters = new StreetLimitationParameters(); - OsmModuleBuilder(Collection providers, Graph graph, VehicleParkingService parkingService) { + OsmModuleBuilder( + Collection providers, + Graph graph, + VehicleParkingService parkingService + ) { this.providers = providers; this.graph = graph; this.parkingService = parkingService; @@ -84,6 +88,7 @@ public OsmModule build() { return new OsmModule( providers, graph, + parkingService, issueStore, streetLimitationParameters, new OsmProcessingParameters( diff --git a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java index 9ca6dc27b04..4510aa0f099 100644 --- a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java +++ b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java @@ -11,6 +11,7 @@ import org.opentripplanner.netex.config.NetexFeedParameters; import org.opentripplanner.netex.loader.NetexDataSourceHierarchy; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; @@ -36,6 +37,7 @@ public NetexConfigure(BuildConfig builderParams) { public NetexModule createNetexModule( Iterable> netexSources, TimetableRepository timetableRepository, + VehicleParkingService parkingService, Graph graph, DataImportIssueStore issueStore ) { @@ -52,6 +54,7 @@ public NetexModule createNetexModule( return new NetexModule( graph, timetableRepository, + parkingService, issueStore, buildParams.getSubwayAccessTimeSeconds(), buildParams.getTransitServicePeriod(), diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index 14b5d1e04e2..b046bf34c97 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -150,5 +150,4 @@ default DataOverlayContext dataOverlayContext(RouteRequest request) { @Nullable SorlandsbanenNorwayService sorlandsbanenService(); - } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 279c3c48368..643cc1fa1a6 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -18,6 +18,7 @@ import org.opentripplanner.routing.algorithm.raptoradapter.transit.mappers.TransitLayerMapper; import org.opentripplanner.routing.algorithm.raptoradapter.transit.mappers.TransitLayerUpdater; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; @@ -163,6 +164,7 @@ private void setupTransitRoutingServer() { graph(), realtimeVehicleRepository(), vehicleRentalRepository(), + vehicleParkingService(), timetableRepository(), routerConfig().updaterConfig() ); @@ -266,6 +268,10 @@ public VehicleRentalRepository vehicleRentalRepository() { return factory.vehicleRentalRepository(); } + public VehicleParkingService vehicleParkingService() { + return factory.vehicleParkingService(); + } + public Graph graph() { return factory.graph(); } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index 7191b82e814..0d9874d6ca0 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -18,6 +18,7 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleRepositoryModule; @@ -74,6 +75,7 @@ public interface ConstructApplicationFactory { RealtimeVehicleRepository realtimeVehicleRepository(); RealtimeVehicleService realtimeVehicleService(); VehicleRentalRepository vehicleRentalRepository(); + VehicleParkingService vehicleParkingService(); VehicleRentalService vehicleRentalService(); DataImportIssueSummary dataImportIssueSummary(); @@ -116,6 +118,9 @@ interface Builder { @BindsInstance Builder worldEnvelopeRepository(WorldEnvelopeRepository worldEnvelopeRepository); + @BindsInstance + Builder worldEnvelopeRepository(VehicleParkingService vehicleParkingService); + @BindsInstance Builder stopConsolidationRepository( @Nullable StopConsolidationRepository stopConsolidationRepository diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java index ab0f242f834..5b748a310bc 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java @@ -15,6 +15,7 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; @@ -37,6 +38,7 @@ OtpServerRequestContext providesServerContext( WorldEnvelopeService worldEnvelopeService, RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, List rideHailingServices, @Nullable StopConsolidationService stopConsolidationService, StreetLimitationParametersService streetLimitationParametersService, @@ -59,6 +61,7 @@ OtpServerRequestContext providesServerContext( worldEnvelopeService, realtimeVehicleService, vehicleRentalService, + vehicleParkingService, emissionsService, sorlandsbanenService, routerConfig.flexParameters(), diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 9f38db5c420..4a432ca7e73 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -20,6 +20,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.service.DefaultRoutingService; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; @@ -47,6 +48,7 @@ public class DefaultServerRequestContext implements OtpServerRequestContext { private final WorldEnvelopeService worldEnvelopeService; private final RealtimeVehicleService realtimeVehicleService; private final VehicleRentalService vehicleRentalService; + private final VehicleParkingService vehicleParkingService; private final EmissionsService emissionsService; @Nullable @@ -73,6 +75,7 @@ private DefaultServerRequestContext( WorldEnvelopeService worldEnvelopeService, RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, @Nullable EmissionsService emissionsService, @Nullable SorlandsbanenNorwayService sorlandsbanenService, List rideHailingServices, @@ -90,6 +93,7 @@ private DefaultServerRequestContext( this.tileRendererManager = tileRendererManager; this.vectorTileConfig = vectorTileConfig; this.vehicleRentalService = vehicleRentalService; + this.vehicleParkingService = vehicleParkingService; this.flexParameters = flexParameters; this.traverseVisitor = traverseVisitor; this.routeRequestDefaults = routeRequestDefaults; @@ -117,6 +121,7 @@ public static DefaultServerRequestContext create( WorldEnvelopeService worldEnvelopeService, RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, @Nullable EmissionsService emissionsService, @Nullable SorlandsbanenNorwayService sorlandsbanenService, FlexParameters flexParameters, @@ -138,6 +143,7 @@ public static DefaultServerRequestContext create( worldEnvelopeService, realtimeVehicleService, vehicleRentalService, + vehicleParkingService, emissionsService, sorlandsbanenService, rideHailingServices, @@ -201,6 +207,11 @@ public VehicleRentalService vehicleRentalService() { return vehicleRentalService; } + @Override + public VehicleParkingService getVehicleParkingService() { + return vehicleParkingService; + } + @Override public TransitTuningParameters transitTuningParameters() { return transitRoutingConfig; diff --git a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java index feea541741c..a51599f2f33 100644 --- a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java +++ b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java @@ -11,6 +11,7 @@ import org.opentripplanner.model.TimetableSnapshot; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.transit.service.TimetableRepository; @@ -49,6 +50,7 @@ public class UpdaterConfigurator { private final UpdatersParameters updatersParameters; private final RealtimeVehicleRepository realtimeVehicleRepository; private final VehicleRentalRepository vehicleRentalRepository; + private final VehicleParkingService vehicleParkingService; private SiriTimetableSnapshotSource siriTimetableSnapshotSource = null; private TimetableSnapshotSource gtfsTimetableSnapshotSource = null; @@ -56,6 +58,7 @@ private UpdaterConfigurator( Graph graph, RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, + VehicleParkingService vehicleParkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -64,12 +67,14 @@ private UpdaterConfigurator( this.vehicleRentalRepository = vehicleRentalRepository; this.timetableRepository = timetableRepository; this.updatersParameters = updatersParameters; + this.vehicleParkingService = vehicleParkingService; } public static void configure( Graph graph, RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, + VehicleParkingService vehicleParkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -77,6 +82,7 @@ public static void configure( graph, realtimeVehicleRepository, vehicleRentalRepository, + vehicleParkingService, timetableRepository, updatersParameters ) @@ -195,22 +201,13 @@ private List createUpdatersFromConfig() { openingHoursCalendarService ); updaters.add( - new VehicleParkingUpdater( - configItem, - source, - graph.getLinker(), - graph.getVehicleParkingService() - ) + new VehicleParkingUpdater(configItem, source, graph.getLinker(), vehicleParkingService) ); } case AVAILABILITY_ONLY -> { var source = AvailabilityDatasourceFactory.create(configItem); updaters.add( - new VehicleParkingAvailabilityUpdater( - configItem, - source, - graph.getVehicleParkingService() - ) + new VehicleParkingAvailabilityUpdater(configItem, source, vehicleParkingService) ); } } diff --git a/application/src/test/java/org/opentripplanner/ConstantsForTests.java b/application/src/test/java/org/opentripplanner/ConstantsForTests.java index aeacc11eca4..b1d1080043c 100644 --- a/application/src/test/java/org/opentripplanner/ConstantsForTests.java +++ b/application/src/test/java/org/opentripplanner/ConstantsForTests.java @@ -31,6 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink; @@ -135,7 +136,7 @@ public static TestOtpModel buildNewPortlandGraph(boolean withElevation) { { OsmProvider osmProvider = new OsmProvider(PORTLAND_CENTRAL_OSM, false); OsmModule osmModule = OsmModule - .of(osmProvider, graph) + .of(osmProvider, graph, new VehicleParkingService()) .withStaticParkAndRide(true) .withStaticBikeParkAndRide(true) .build(); @@ -184,7 +185,7 @@ public static TestOtpModel buildOsmGraph(File osmFile) { var timetableRepository = new TimetableRepository(siteRepository, deduplicator); // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); - OsmModule osmModule = OsmModule.of(osmProvider, graph).build(); + OsmModule osmModule = OsmModule.of(osmProvider, graph, new VehicleParkingService()).build(); osmModule.buildGraph(); return new TestOtpModel(graph, timetableRepository); } catch (Exception e) { @@ -226,12 +227,13 @@ public static TestOtpModel buildNewMinimalNetexGraph() { try { var deduplicator = new Deduplicator(); var siteRepository = new SiteRepository(); + var parkingService = new VehicleParkingService(); var graph = new Graph(deduplicator); var timetableRepository = new TimetableRepository(siteRepository, deduplicator); // Add street data from OSM { OsmProvider osmProvider = new OsmProvider(OSLO_EAST_OSM, false); - OsmModule osmModule = OsmModule.of(osmProvider, graph).build(); + OsmModule osmModule = OsmModule.of(osmProvider, graph, parkingService).build(); osmModule.buildGraph(); } // Add transit data from Netex @@ -244,7 +246,13 @@ public static TestOtpModel buildNewMinimalNetexGraph() { var sources = List.of(new ConfiguredDataSource<>(NETEX_MINIMAL_DATA_SOURCE, netexConfig)); new NetexConfigure(buildConfig) - .createNetexModule(sources, timetableRepository, graph, DataImportIssueStore.NOOP) + .createNetexModule( + sources, + timetableRepository, + parkingService, + graph, + DataImportIssueStore.NOOP + ) .buildGraph(); } // Link transit stops to streets diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index 38bbd81316b..4efc74901e5 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -9,6 +9,7 @@ import org.opentripplanner.ext.emissions.EmissionsService; import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; @@ -54,6 +55,7 @@ public static OtpServerRequestContext createServerContext( createWorldEnvelopeService(), createRealtimeVehicleService(transitService), createVehicleRentalService(), + createVehicleParkingService(), createEmissionsService(), null, routerConfig.flexParameters(), @@ -87,6 +89,10 @@ public static VehicleRentalService createVehicleRentalService() { return new DefaultVehicleRentalService(); } + public static VehicleParkingService createVehicleParkingService() { + return new VehicleParkingService(); + } + public static EmissionsService createEmissionsService() { return new DefaultEmissionsService(new EmissionsDataModel()); } diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 5d79c24d05f..7700ae7baf0 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -69,6 +69,7 @@ import org.opentripplanner.routing.impl.TransitAlertServiceImpl; import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; @@ -140,22 +141,21 @@ class GraphQLIntegrationTest { private static GraphQLRequestContext context; private static final Deduplicator DEDUPLICATOR = new Deduplicator(); + private static final VehicleParkingService parkingService = new VehicleParkingService(); @BeforeAll static void setup() { - GRAPH - .getVehicleParkingService() - .updateVehicleParking( - List.of( - VehicleParking - .builder() - .id(id("parking-1")) - .coordinate(WgsCoordinate.GREENWICH) - .name(NonLocalizedString.ofNullable("parking")) - .build() - ), - List.of() - ); + parkingService.updateVehicleParking( + List.of( + VehicleParking + .builder() + .id(id("parking-1")) + .coordinate(WgsCoordinate.GREENWICH) + .name(NonLocalizedString.ofNullable("parking")) + .build() + ), + List.of() + ); var siteRepository = TEST_MODEL.siteRepositoryBuilder(); STOP_LOCATIONS.forEach(siteRepository::withRegularStop); @@ -315,7 +315,7 @@ public Set getRoutesForStop(StopLocation stop) { new TestRoutingService(List.of(i1)), transitService, new DefaultFareService(), - GRAPH.getVehicleParkingService(), + parkingService, defaultVehicleRentalService, realtimeVehicleService, finder, diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java index d81b5cf0d43..993883893b9 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java @@ -34,6 +34,7 @@ import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.street.search.TraverseMode; @@ -60,7 +61,7 @@ class LegacyRouteRequestMapperTest implements PlanTestConstants { new TestRoutingService(List.of()), transitService, new DefaultFareService(), - graph.getVehicleParkingService(), + new VehicleParkingService(), new DefaultVehicleRentalService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java index cf1dc759a3e..8c9541e7e4b 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java @@ -30,6 +30,7 @@ import org.opentripplanner.routing.api.request.preference.ItineraryFilterDebugProfile; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -70,7 +71,7 @@ class RouteRequestMapperTest { new TestRoutingService(List.of()), transitService, new DefaultFareService(), - graph.getVehicleParkingService(), + new VehicleParkingService(), new DefaultVehicleRentalService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 372cda4f308..141e8d2c818 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -46,6 +46,7 @@ import org.opentripplanner.routing.api.request.via.ViaLocation; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; @@ -144,6 +145,7 @@ void setup() { new DefaultWorldEnvelopeService(new DefaultWorldEnvelopeRepository()), new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), + new VehicleParkingService(), new DefaultEmissionsService(new EmissionsDataModel()), null, RouterConfig.DEFAULT.flexParameters(), diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java index a2e7ebef402..3ac86be3fba 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java @@ -14,6 +14,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.edge.BoardingLocationToStopLink; import org.opentripplanner.street.model.edge.Edge; @@ -83,7 +84,7 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVerti new NonLocalizedString("bus stop not connected to street network") ); var osmModule = OsmModule - .of(provider, graph) + .of(provider, graph, new VehicleParkingService()) .withBoardingAreaRefTags(Set.of("ref", "ref:IFOPT")) .withAreaVisibility(areaVisibility) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index fd7996aefe3..407d2f630c7 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -18,6 +18,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetTransitStopLink; @@ -170,7 +171,14 @@ public TestModel() { graph.addVertex(stopVertex); graph.hasStreets = true; - module = new StreetLinkerModule(graph, timetableRepository, DataImportIssueStore.NOOP, false); + module = + new StreetLinkerModule( + graph, + new VehicleParkingService(), + timetableRepository, + DataImportIssueStore.NOOP, + false + ); assertFalse(stopVertex.isConnectedToGraph()); assertTrue(stopVertex.getIncoming().isEmpty()); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index 49627c6231d..224e23b5d8e 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -2,12 +2,20 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.transit.service.TimetableRepository; public class TestStreetLinkerModule { /** For test only */ public static void link(Graph graph, TimetableRepository model) { - new StreetLinkerModule(graph, model, DataImportIssueStore.NOOP, false).buildGraph(); + new StreetLinkerModule( + graph, + new VehicleParkingService(), + model, + DataImportIssueStore.NOOP, + false + ) + .buildGraph(); } } diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index d7f75f530d1..cad2584914a 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -10,6 +10,7 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.routing.vehicle_parking.VehicleParkingTestGraphData; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; @@ -169,7 +170,7 @@ public void removeVehicleParkingWithOneEntranceAndNonExistingVertexTest() { ) .build(); - var vehicleParkingService = graph.getVehicleParkingService(); + var vehicleParkingService = new VehicleParkingService(); vehicleParkingService.updateVehicleParking(List.of(vehicleParking), List.of()); helper.linkVehicleParkingToGraph(vehicleParking); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java index c59adad6fd5..fcd76fc5e0a 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java @@ -5,6 +5,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.service.SiteRepository; import org.opentripplanner.transit.service.TimetableRepository; @@ -24,7 +25,10 @@ static Graph buildOsmGraph( var timetableRepository = new TimetableRepository(new SiteRepository(), deduplicator); // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); - OsmModule osmModule = OsmModule.of(osmProvider, graph).withEdgeNamer(new TestNamer()).build(); + OsmModule osmModule = OsmModule + .of(osmProvider, graph, new VehicleParkingService()) + .withEdgeNamer(new TestNamer()) + .build(); osmModule.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java index 6bda39e5058..e4bb6f4ad9e 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java @@ -21,6 +21,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetEdge; @@ -157,7 +158,7 @@ public static TestOtpModel buildGraphNoTransit() { File file = ResourceLoader.of(LinkingTest.class).file("columbus.osm.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule osmModule = OsmModule.of(provider, gg).build(); + OsmModule osmModule = OsmModule.of(provider, gg, new VehicleParkingService()).build(); osmModule.buildGraph(); return new TestOtpModel(gg, timetableRepository); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 0b3d762ed6e..a9ac1a10e54 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -32,6 +32,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.impl.GraphPathFinder; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.vertex.BarrierVertex; @@ -56,7 +57,10 @@ public void testGraphBuilder() { OsmProvider provider = new OsmProvider(file, true); - OsmModule osmModule = OsmModule.of(provider, gg).withAreaVisibility(true).build(); + OsmModule osmModule = OsmModule + .of(provider, gg, new VehicleParkingService()) + .withAreaVisibility(true) + .build(); osmModule.buildGraph(); @@ -112,7 +116,10 @@ public void testBuildGraphDetailed() { File file = RESOURCE_LOADER.file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); - OsmModule osmModule = OsmModule.of(provider, gg).withAreaVisibility(true).build(); + OsmModule osmModule = OsmModule + .of(provider, gg, new VehicleParkingService()) + .withAreaVisibility(true) + .build(); osmModule.buildGraph(); @@ -275,9 +282,8 @@ public void testLocalizedString() { @Test void addParkingLotsToService() { - Graph graph = buildParkingLots(); + var service = buildParkingLots().service; - var service = graph.getVehicleParkingService(); assertEquals(11, service.getVehicleParkings().count()); assertEquals(6, service.getBikeParks().count()); assertEquals(5, service.getCarParks().count()); @@ -285,7 +291,7 @@ void addParkingLotsToService() { @Test void createArtificalEntrancesToUnlikedParkingLots() { - Graph graph = buildParkingLots(); + var graph = buildParkingLots().graph; graph .getVerticesOfType(VehicleParkingEntranceVertex.class) @@ -307,7 +313,7 @@ void testBarrierAtEnd() { File file = RESOURCE_LOADER.file("accessno-at-end.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule loader = OsmModule.of(provider, graph).build(); + OsmModule loader = OsmModule.of(provider, graph, new VehicleParkingService()).build(); loader.buildGraph(); Vertex start = graph.getVertex(VertexLabel.osm(1)); @@ -322,22 +328,25 @@ void testBarrierAtEnd() { assertEquals(barrier.getBarrierPermissions(), ALL); } - private Graph buildParkingLots() { + private BuildResult buildParkingLots() { var graph = new Graph(); + var service = new VehicleParkingService(); var providers = Stream .of("B+R.osm.pbf", "P+R.osm.pbf") .map(RESOURCE_LOADER::file) .map(f -> new OsmProvider(f, false)) .toList(); var module = OsmModule - .of(providers, graph) + .of(providers, graph, service) .withStaticParkAndRide(true) .withStaticBikeParkAndRide(true) .build(); module.buildGraph(); - return graph; + return new BuildResult(graph, service); } + private record BuildResult(Graph graph, VehicleParkingService service) {} + /** * This reads test file with area and tests if it can be routed if visibility is used and if it * isn't @@ -354,7 +363,10 @@ private void testBuildingAreas(boolean skipVisibility) { File file = RESOURCE_LOADER.file("usf_area.osm.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule loader = OsmModule.of(provider, graph).withAreaVisibility(!skipVisibility).build(); + OsmModule loader = OsmModule + .of(provider, graph, new VehicleParkingService()) + .withAreaVisibility(!skipVisibility) + .build(); loader.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java index 2a5d4e8a163..b72dceb5814 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -29,7 +30,10 @@ public void testLinkEntriesToPlatforms() { OsmProvider provider = new OsmProvider(file, false); - OsmModule osmModule = OsmModule.of(provider, gg).withPlatformEntriesLinking(true).build(); + OsmModule osmModule = OsmModule + .of(provider, gg, new VehicleParkingService()) + .withPlatformEntriesLinking(true) + .build(); osmModule.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java index bbf59ad9c53..1778e7306b5 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java @@ -21,6 +21,7 @@ import org.opentripplanner.routing.api.request.request.filter.AllowAllTransitFilter; import org.opentripplanner.routing.api.request.request.filter.TransitFilter; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -50,7 +51,10 @@ public static void onlyOnce() { File file = ResourceLoader.of(TriangleInequalityTest.class).file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); - OsmModule osmModule = OsmModule.of(provider, graph).withAreaVisibility(true).build(); + OsmModule osmModule = OsmModule + .of(provider, graph, new VehicleParkingService()) + .withAreaVisibility(true) + .build(); osmModule.buildGraph(); } diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java index 492d04a0007..8c98261340c 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java @@ -13,6 +13,7 @@ import org.opentripplanner.graph_builder.module.TestStreetLinkerModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; @@ -162,7 +163,7 @@ private Graph buildOsmGraph(String osmFileName, DataImportIssueStore issueStore) var timetableRepository = new TimetableRepository(siteRepository, deduplicator); OsmProvider provider = new OsmProvider(RESOURCE_LOADER.file(osmFileName), false); OsmModule loader = OsmModule - .of(provider, graph) + .of(provider, graph, new VehicleParkingService()) .withIssueStore(issueStore) .withAreaVisibility(true) .withStaticParkAndRide(true) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java index b759ace9b94..17b29a1585f 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java @@ -10,6 +10,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -37,7 +38,10 @@ public void setUp() throws Exception { var osmDataFile = ResourceLoader.of(UnroutableTest.class).file("bridge_construction.osm.pbf"); OsmProvider provider = new OsmProvider(osmDataFile, true); - OsmModule osmBuilder = OsmModule.of(provider, graph).withAreaVisibility(true).build(); + OsmModule osmBuilder = OsmModule + .of(provider, graph, new VehicleParkingService()) + .withAreaVisibility(true) + .build(); osmBuilder.buildGraph(); } diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index f0e87b046c5..29d5d27fb3d 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -22,6 +22,7 @@ import org.opentripplanner.routing.framework.DebugTimingAggregator; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.standalone.OtpStartupInfo; @@ -98,6 +99,7 @@ public SpeedTest( graph, new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), + new VehicleParkingService(), timetableRepository, config.updatersConfig ); @@ -120,6 +122,7 @@ public SpeedTest( TestServerContext.createWorldEnvelopeService(), TestServerContext.createRealtimeVehicleService(transitService), TestServerContext.createVehicleRentalService(), + TestServerContext.createVehicleParkingService(), TestServerContext.createEmissionsService(), null, config.flexConfig, diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index 44a37943d8b..2f09fca8216 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -12,6 +12,7 @@ import org.mockito.Mockito; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.routing.vehicle_parking.VehicleParkingTestGraphData; @@ -35,6 +36,7 @@ class VehicleParkingUpdaterTest { private DefaultRealTimeUpdateContext realTimeUpdateContext; private VehicleParkingUpdater vehicleParkingUpdater; + private VehicleParkingService vehicleParkingService; @BeforeEach @SuppressWarnings("unchecked") @@ -43,6 +45,7 @@ public void setup() { graphData.initGraph(); graph = graphData.getGraph(); timetableRepository = graphData.getTimetableRepository(); + vehicleParkingService = new VehicleParkingService(); realTimeUpdateContext = new DefaultRealTimeUpdateContext(graph, timetableRepository); dataSource = (DataSource) Mockito.mock(DataSource.class); @@ -73,12 +76,7 @@ public String configRef() { } }; vehicleParkingUpdater = - new VehicleParkingUpdater( - parameters, - dataSource, - graph.getLinker(), - graph.getVehicleParkingService() - ); + new VehicleParkingUpdater(parameters, dataSource, graph.getLinker(), vehicleParkingService); } @Test @@ -106,8 +104,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - var vehicleParkingInGraph = graph - .getVehicleParkingService() + var vehicleParkingInGraph = vehicleParkingService .getVehicleParkings() .findFirst() .orElseThrow(); @@ -123,8 +120,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - vehicleParkingInGraph = - graph.getVehicleParkingService().getVehicleParkings().findFirst().orElseThrow(); + vehicleParkingInGraph = vehicleParkingService.getVehicleParkings().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); } @@ -159,7 +155,7 @@ void addNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, graph.getVehicleParkingService().getVehicleParkings().count()); + assertEquals(1, vehicleParkingService.getVehicleParkings().count()); assertVehicleParkingNotLinked(); } @@ -176,7 +172,6 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - var vehicleParkingService = graph.getVehicleParkingService(); assertEquals(1, vehicleParkingService.getVehicleParkings().count()); assertEquals( vehiclePlaces, @@ -214,7 +209,6 @@ void deleteNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - var vehicleParkingService = graph.getVehicleParkingService(); assertEquals(1, vehicleParkingService.getVehicleParkings().count()); when(dataSource.getUpdates()).thenReturn(List.of()); @@ -261,10 +255,7 @@ private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { ); } - assertEquals( - vehicleParkingNumber, - graph.getVehicleParkingService().getVehicleParkings().count() - ); + assertEquals(vehicleParkingNumber, vehicleParkingService.getVehicleParkings().count()); } private void runUpdaterOnce() { From 585ba4e686363ad0b86a64d62a77f5d48878d231 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 8 Nov 2024 21:03:31 +0100 Subject: [PATCH 03/55] Serialized vehicle parking to serialized graph --- .../ext/parkAndRideApi/ParkAndRideResource.java | 2 +- .../ext/restapi/resources/Routers.java | 2 +- .../ext/vectortiles/VectorTilesResource.java | 4 ++-- .../apis/gtfs/GraphQLRequestContext.java | 4 ++-- .../apis/transmodel/support/GqlUtil.java | 2 +- .../routing/graph/SerializedGraphObject.java | 4 ++++ .../vehicle_parking/VehicleParkingService.java | 4 ++++ .../org/opentripplanner/standalone/OTPMain.java | 1 + .../standalone/api/OtpServerRequestContext.java | 2 +- .../standalone/configure/ConstructApplication.java | 4 +++- .../configure/ConstructApplicationFactory.java | 2 +- .../standalone/configure/LoadApplication.java | 5 +++++ .../configure/LoadApplicationFactory.java | 4 ++++ .../server/DefaultServerRequestContext.java | 2 +- .../apis/gtfs/GraphQLIntegrationTest.java | 2 +- .../routerequest/LegacyRouteRequestMapperTest.java | 2 +- .../routerequest/RouteRequestMapperTest.java | 2 +- .../routing/graph/GraphSerializationTest.java | 14 +++++++++++++- 18 files changed, 47 insertions(+), 15 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java index ec1ac7348d7..fcf40a7b2f8 100644 --- a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java @@ -36,7 +36,7 @@ public ParkAndRideResource( */ @Deprecated @PathParam("ignoreRouterId") String ignoreRouterId ) { - this.vehicleParkingService = serverContext.getVehicleParkingService(); + this.vehicleParkingService = serverContext.vehicleParkingService(); // TODO OTP2 - Why are we using the DirectGraphFinder here, not just // - serverContext.graphFinder(). This needs at least a comment! diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java index d5dae967568..6c805560b8b 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/Routers.java @@ -66,7 +66,7 @@ private ApiRouterInfo getRouterInfo() { serverContext.graph(), serverContext.transitService(), serverContext.vehicleRentalService(), - serverContext.getVehicleParkingService(), + serverContext.vehicleParkingService(), serverContext.worldEnvelopeService().envelope().orElseThrow() ); } catch (GraphNotFoundException e) { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java index ada19316866..779875b8675 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java @@ -140,12 +140,12 @@ private static LayerBuilder createLayerBuilder( layerParameters ); case VehicleParking -> new VehicleParkingsLayerBuilder( - context.getVehicleParkingService(), + context.vehicleParkingService(), layerParameters, locale ); case VehicleParkingGroup -> new VehicleParkingGroupsLayerBuilder( - context.getVehicleParkingService(), + context.vehicleParkingService(), layerParameters, locale ); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java index 084a1e2dfc9..c3f9fc0656a 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java @@ -14,8 +14,8 @@ public record GraphQLRequestContext( RoutingService routingService, TransitService transitService, FareService fareService, - VehicleParkingService vehicleParkingService, VehicleRentalService vehicleRentalService, + VehicleParkingService vehicleParkingService, RealtimeVehicleService realTimeVehicleService, GraphFinder graphFinder, RouteRequest defaultRouteRequest @@ -25,8 +25,8 @@ public static GraphQLRequestContext ofServerContext(OtpServerRequestContext cont context.routingService(), context.transitService(), context.graph().getFareService(), - context.getVehicleParkingService(), context.vehicleRentalService(), + context.vehicleParkingService(), context.realtimeVehicleService(), context.graphFinder(), context.defaultRouteRequest() diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java index a9f5414683b..90ba7156cd6 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java @@ -38,7 +38,7 @@ public static VehicleParkingService getVehicleParkingService( DataFetchingEnvironment environment ) { return ((TransmodelRequestContext) environment.getContext()).getServerContext() - .getVehicleParkingService(); + .vehicleParkingService(); } public static GraphFinder getGraphFinder(DataFetchingEnvironment environment) { diff --git a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java index 0843124131b..b518a47eedf 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java @@ -25,6 +25,7 @@ import org.opentripplanner.model.projectinfo.GraphFileHeader; import org.opentripplanner.model.projectinfo.OtpProjectInfo; import org.opentripplanner.routing.graph.kryosupport.KryoBuilder; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.standalone.config.RouterConfig; @@ -79,11 +80,13 @@ public class SerializedGraphObject implements Serializable { private final int routingTripPatternCounter; public final EmissionsDataModel emissionsDataModel; public final StreetLimitationParameters streetLimitationParameters; + public final VehicleParkingService vehicleParkingService; public SerializedGraphObject( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, + VehicleParkingService vehicleParkingService, BuildConfig buildConfig, RouterConfig routerConfig, DataImportIssueSummary issueSummary, @@ -95,6 +98,7 @@ public SerializedGraphObject( this.edges = graph.getEdges(); this.timetableRepository = timetableRepository; this.worldEnvelopeRepository = worldEnvelopeRepository; + this.vehicleParkingService = vehicleParkingService; this.buildConfig = buildConfig; this.routerConfig = routerConfig; this.issueSummary = issueSummary; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java index b0c08a2309b..7348caf7589 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java @@ -3,6 +3,7 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.Multimap; +import jakarta.inject.Inject; import java.io.Serializable; import java.util.Collection; import java.util.HashSet; @@ -19,6 +20,9 @@ */ public class VehicleParkingService implements Serializable { + @Inject + public VehicleParkingService() {} + /** * To ensure that his is thread-safe, the set stored here should always be immutable. *

diff --git a/application/src/main/java/org/opentripplanner/standalone/OTPMain.java b/application/src/main/java/org/opentripplanner/standalone/OTPMain.java index a8096d806ba..fd283abd8cd 100644 --- a/application/src/main/java/org/opentripplanner/standalone/OTPMain.java +++ b/application/src/main/java/org/opentripplanner/standalone/OTPMain.java @@ -152,6 +152,7 @@ private static void startOTPServer(CommandLineParameters cli) { app.graph(), app.timetableRepository(), app.worldEnvelopeRepository(), + app.vehicleParkingService(), config.buildConfig(), config.routerConfig(), DataImportIssueSummary.combine(graphBuilder.issueSummary(), app.dataImportIssueSummary()), diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index b046bf34c97..3ad83462612 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -97,7 +97,7 @@ public interface OtpServerRequestContext { VehicleRentalService vehicleRentalService(); - VehicleParkingService getVehicleParkingService(); + VehicleParkingService vehicleParkingService(); TransitTuningParameters transitTuningParameters(); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 643cc1fa1a6..23fa92a0217 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -76,6 +76,7 @@ public class ConstructApplication { GraphBuilderDataSources graphBuilderDataSources, DataImportIssueSummary issueSummary, EmissionsDataModel emissionsDataModel, + VehicleParkingService vehicleParkingService, @Nullable StopConsolidationRepository stopConsolidationRepository, StreetLimitationParameters streetLimitationParameters ) { @@ -87,13 +88,14 @@ public class ConstructApplication { var graphVisualizer = cli.visualize ? new GraphVisualizer(graph) : null; this.factory = - DaggerConstructApplicationFactory + org.opentripplanner.standalone.configure.DaggerConstructApplicationFactory .builder() .configModel(config) .graph(graph) .timetableRepository(timetableRepository) .graphVisualizer(graphVisualizer) .worldEnvelopeRepository(worldEnvelopeRepository) + .vehicleParkingService(vehicleParkingService) .emissionsDataModel(emissionsDataModel) .dataImportIssueSummary(issueSummary) .stopConsolidationRepository(stopConsolidationRepository) diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index 0d9874d6ca0..9af2f99c436 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -119,7 +119,7 @@ interface Builder { Builder worldEnvelopeRepository(WorldEnvelopeRepository worldEnvelopeRepository); @BindsInstance - Builder worldEnvelopeRepository(VehicleParkingService vehicleParkingService); + Builder vehicleParkingService(VehicleParkingService vehicleParkingService); @BindsInstance Builder stopConsolidationRepository( diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java index 300eb24f997..4cc774fc7ec 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java @@ -8,6 +8,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.CommandLineParameters; import org.opentripplanner.standalone.config.ConfigModel; @@ -56,6 +57,7 @@ public ConstructApplication appConstruction(SerializedGraphObject obj) { obj.graph, obj.timetableRepository, obj.worldEnvelopeRepository, + obj.vehicleParkingService, obj.issueSummary, obj.emissionsDataModel, obj.stopConsolidationRepository, @@ -69,6 +71,7 @@ public ConstructApplication appConstruction() { factory.emptyGraph(), factory.emptyTimetableRepository(), factory.emptyWorldEnvelopeRepository(), + factory.emptyVehicleParkingService(), DataImportIssueSummary.empty(), factory.emptyEmissionsDataModel(), factory.emptyStopConsolidationRepository(), @@ -91,6 +94,7 @@ private ConstructApplication createAppConstruction( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, + VehicleParkingService vehicleParkingService, DataImportIssueSummary issueSummary, @Nullable EmissionsDataModel emissionsDataModel, @Nullable StopConsolidationRepository stopConsolidationRepository, @@ -105,6 +109,7 @@ private ConstructApplication createAppConstruction( graphBuilderDataSources(), issueSummary, emissionsDataModel, + vehicleParkingService, stopConsolidationRepository, streetLimitationParameters ); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java index 8d11d645c48..7d5ee01c72f 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java @@ -11,6 +11,7 @@ import org.opentripplanner.ext.stopconsolidation.configure.StopConsolidationRepositoryModule; import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.configure.WorldEnvelopeRepositoryModule; import org.opentripplanner.standalone.config.CommandLineParameters; @@ -58,6 +59,9 @@ public interface LoadApplicationFactory { @Singleton StreetLimitationParameters emptyStreetLimitationParameters(); + @Singleton + VehicleParkingService emptyVehicleParkingService(); + @Component.Builder interface Builder { @BindsInstance diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 4a432ca7e73..1e906a507d3 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -208,7 +208,7 @@ public VehicleRentalService vehicleRentalService() { } @Override - public VehicleParkingService getVehicleParkingService() { + public VehicleParkingService vehicleParkingService() { return vehicleParkingService; } diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 7700ae7baf0..5d12b85a45b 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -315,8 +315,8 @@ public Set getRoutesForStop(StopLocation stop) { new TestRoutingService(List.of(i1)), transitService, new DefaultFareService(), - parkingService, defaultVehicleRentalService, + parkingService, realtimeVehicleService, finder, new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java index 993883893b9..eb184f17c9d 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java @@ -61,8 +61,8 @@ class LegacyRouteRequestMapperTest implements PlanTestConstants { new TestRoutingService(List.of()), transitService, new DefaultFareService(), - new VehicleParkingService(), new DefaultVehicleRentalService(), + new VehicleParkingService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java index 8c9541e7e4b..521ed211b7a 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java @@ -71,8 +71,8 @@ class RouteRequestMapperTest { new TestRoutingService(List.of()), transitService, new DefaultFareService(), - new VehicleParkingService(), new DefaultVehicleRentalService(), + new VehicleParkingService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index 47568fa1252..d9d7f178c29 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -23,6 +23,7 @@ import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; @@ -67,7 +68,14 @@ public void testRoundTripSerializationForGTFSGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewPortlandGraph(true); var weRepo = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); - testRoundTrip(model.graph(), model.timetableRepository(), weRepo, emissionsDataModel); + var parkingService = new VehicleParkingService(); + testRoundTrip( + model.graph(), + model.timetableRepository(), + weRepo, + parkingService, + emissionsDataModel + ); } /** @@ -78,10 +86,12 @@ public void testRoundTripSerializationForNetexGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewMinimalNetexGraph(); var worldEnvelopeRepository = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); + var parkingService = new VehicleParkingService(); testRoundTrip( model.graph(), model.timetableRepository(), worldEnvelopeRepository, + parkingService, emissionsDataModel ); } @@ -182,6 +192,7 @@ private void testRoundTrip( Graph originalGraph, TimetableRepository originalTimetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, + VehicleParkingService vehicleParkingService, EmissionsDataModel emissionsDataModel ) throws Exception { // Now round-trip the graph through serialization. @@ -192,6 +203,7 @@ private void testRoundTrip( originalGraph, originalTimetableRepository, worldEnvelopeRepository, + vehicleParkingService, BuildConfig.DEFAULT, RouterConfig.DEFAULT, DataImportIssueSummary.empty(), From d00dbdeea2ab3afdd6b69b4e002d0d37e963cb30 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 8 Nov 2024 21:42:17 +0100 Subject: [PATCH 04/55] Inject into graph builder --- .../java/org/opentripplanner/graph_builder/GraphBuilder.java | 3 +++ .../standalone/configure/ConstructApplication.java | 1 + 2 files changed, 4 insertions(+) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java index bc83ad2a8af..324a56bd18b 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java @@ -18,6 +18,7 @@ import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.graph_builder.module.configure.DaggerGraphBuilderFactory; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; @@ -63,6 +64,7 @@ public static GraphBuilder create( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, + VehicleParkingService vehicleParkingService, @Nullable EmissionsDataModel emissionsDataModel, @Nullable StopConsolidationRepository stopConsolidationRepository, StreetLimitationParameters streetLimitationParameters, @@ -82,6 +84,7 @@ public static GraphBuilder create( .graph(graph) .timetableRepository(timetableRepository) .worldEnvelopeRepository(worldEnvelopeRepository) + .vehicleParkingService(vehicleParkingService) .stopConsolidationRepository(stopConsolidationRepository) .streetLimitationParameters(streetLimitationParameters) .dataSources(dataSources) diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 23fa92a0217..667a464c5a5 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -130,6 +130,7 @@ public GraphBuilder createGraphBuilder() { graph(), timetableRepository(), factory.worldEnvelopeRepository(), + factory.vehicleParkingService(), factory.emissionsDataModel(), factory.stopConsolidationRepository(), factory.streetLimitationParameters(), From be0196a6c7c59d53cf248c5a7d96b91d28ce718f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 8 Nov 2024 22:05:09 +0100 Subject: [PATCH 05/55] Fix test --- .../standalone/configure/ConstructApplication.java | 2 +- .../module/TestStreetLinkerModule.java | 14 +++++++++++--- .../module/VehicleParkingLinkingTest.java | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 667a464c5a5..a7baa345e36 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -88,7 +88,7 @@ public class ConstructApplication { var graphVisualizer = cli.visualize ? new GraphVisualizer(graph) : null; this.factory = - org.opentripplanner.standalone.configure.DaggerConstructApplicationFactory + DaggerConstructApplicationFactory .builder() .configModel(config) .graph(graph) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index 224e23b5d8e..7333a98afe1 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -8,11 +8,19 @@ public class TestStreetLinkerModule { /** For test only */ - public static void link(Graph graph, TimetableRepository model) { + public static void link(Graph graph, TimetableRepository timetableRepository) { + link(graph, new VehicleParkingService(), timetableRepository); + } + + public static void link( + Graph graph, + VehicleParkingService vehicleParkingService, + TimetableRepository timetableRepository + ) { new StreetLinkerModule( graph, - new VehicleParkingService(), - model, + vehicleParkingService, + timetableRepository, DataImportIssueStore.NOOP, false ) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index cad2584914a..42f016055be 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -176,7 +176,7 @@ public void removeVehicleParkingWithOneEntranceAndNonExistingVertexTest() { graph.remove(A); - TestStreetLinkerModule.link(graph, timetableRepository); + TestStreetLinkerModule.link(graph, vehicleParkingService, timetableRepository); assertEquals(0, graph.getVerticesOfType(VehicleParkingEntranceVertex.class).size()); From 1ce4a7919661665f8573fab158f20561b3511c3b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 10 Nov 2024 09:43:20 +0100 Subject: [PATCH 06/55] Move VehicleParking into 'services' package --- .../VehicleParkingGroupsLayerTest.java | 10 +++++----- .../vehicleparkings/VehicleParkingsLayerTest.java | 8 ++++---- .../ext/vehicleparking/bikely/BikelyUpdaterTest.java | 2 +- .../vehicleparking/hslpark/HslParkUpdaterTest.java | 2 +- .../ext/parkAndRideApi/ParkAndRideResource.java | 4 ++-- .../ext/restapi/mapping/PlaceMapper.java | 2 +- .../ext/restapi/model/ApiRouterInfo.java | 2 +- .../ext/restapi/model/ApiTravelOptionsMaker.java | 2 +- .../DigitransitVehicleParkingPropertyMapper.java | 2 +- .../StadtnaviVehicleParkingPropertyMapper.java | 4 ++-- .../vehicleparkings/VehicleParkingAndGroup.java | 4 ++-- .../VehicleParkingGroupsLayerBuilder.java | 2 +- .../vehicleparkings/VehicleParkingsLayerBuilder.java | 4 ++-- .../ext/vehicleparking/bikeep/BikeepUpdater.java | 6 +++--- .../ext/vehicleparking/bikely/BikelyUpdater.java | 8 ++++---- .../hslpark/HslFacilitiesDownloader.java | 4 ++-- .../hslpark/HslHubToVehicleParkingGroupMapper.java | 2 +- .../vehicleparking/hslpark/HslHubsDownloader.java | 2 +- .../hslpark/HslParkToVehicleParkingMapper.java | 8 ++++---- .../ext/vehicleparking/hslpark/HslParkUpdater.java | 8 ++++---- .../parkapi/BicycleParkAPIUpdater.java | 2 +- .../vehicleparking/parkapi/CarParkAPIUpdater.java | 2 +- .../ext/vehicleparking/parkapi/ParkAPIUpdater.java | 6 +++--- .../apis/gtfs/GraphQLRequestContext.java | 2 +- .../apis/gtfs/datafetchers/BikeParkImpl.java | 2 +- .../apis/gtfs/datafetchers/CarParkImpl.java | 2 +- .../apis/gtfs/datafetchers/NodeTypeResolver.java | 2 +- .../apis/gtfs/datafetchers/PlaceImpl.java | 2 +- .../datafetchers/PlaceInterfaceTypeResolver.java | 2 +- .../apis/gtfs/datafetchers/QueryTypeImpl.java | 5 ++--- .../apis/gtfs/datafetchers/VehicleParkingImpl.java | 6 +++--- .../apis/gtfs/generated/GraphQLDataFetchers.java | 6 +++--- .../apis/transmodel/model/stop/BikeParkType.java | 2 +- .../transmodel/model/stop/PlaceInterfaceType.java | 2 +- .../apis/transmodel/support/GqlUtil.java | 2 +- .../opentripplanner/graph_builder/GraphBuilder.java | 2 +- .../issues/ParkAndRideEntranceRemoved.java | 2 +- .../graph_builder/module/StreetLinkerModule.java | 6 +++--- .../module/configure/GraphBuilderFactory.java | 2 +- .../module/configure/GraphBuilderModules.java | 2 +- .../graph_builder/module/osm/OsmModule.java | 4 ++-- .../graph_builder/module/osm/OsmModuleBuilder.java | 2 +- .../graph_builder/module/osm/ParkingProcessor.java | 6 +++--- .../vector/vertex/VertexPropertyMapper.java | 4 ++-- .../model/impl/OtpTransitServiceBuilder.java | 2 +- .../model/plan/VehicleParkingWithEntrance.java | 4 ++-- .../java/org/opentripplanner/netex/NetexModule.java | 4 ++-- .../netex/configure/NetexConfigure.java | 2 +- .../netex/mapping/VehicleParkingMapper.java | 4 ++-- .../preference/filter/VehicleParkingFilter.java | 2 +- .../preference/filter/VehicleParkingSelect.java | 2 +- .../routing/graph/SerializedGraphObject.java | 2 +- .../graphfinder/PlaceFinderTraverseVisitor.java | 2 +- .../vehicleparking}/VehicleParkingService.java | 4 +++- .../vehicleparking/model}/VehicleParking.java | 2 +- .../model}/VehicleParkingEntrance.java | 2 +- .../vehicleparking/model}/VehicleParkingGroup.java | 2 +- .../model}/VehicleParkingGroupBuilder.java | 2 +- .../vehicleparking/model}/VehicleParkingHelper.java | 2 +- .../vehicleparking/model}/VehicleParkingSpaces.java | 2 +- .../vehicleparking/model}/VehicleParkingState.java | 2 +- .../standalone/api/OtpServerRequestContext.java | 2 +- .../standalone/configure/ConstructApplication.java | 2 +- .../configure/ConstructApplicationFactory.java | 2 +- .../configure/ConstructApplicationModule.java | 2 +- .../standalone/configure/LoadApplication.java | 2 +- .../standalone/configure/LoadApplicationFactory.java | 2 +- .../server/DefaultServerRequestContext.java | 2 +- .../street/model/edge/StreetVehicleParkingLink.java | 2 +- .../street/model/edge/VehicleParkingEdge.java | 2 +- .../model/vertex/VehicleParkingEntranceVertex.java | 4 ++-- .../street/model/vertex/VertexFactory.java | 4 ++-- .../updater/configure/UpdaterConfigurator.java | 2 +- .../VehicleParkingAvailabilityUpdater.java | 6 +++--- .../VehicleParkingDataSourceFactory.java | 2 +- .../vehicle_parking/VehicleParkingUpdater.java | 8 ++++---- .../java/org/opentripplanner/ConstantsForTests.java | 2 +- .../java/org/opentripplanner/TestServerContext.java | 2 +- .../apis/gtfs/GraphQLIntegrationTest.java | 4 ++-- .../routerequest/LegacyRouteRequestMapperTest.java | 2 +- .../mapping/routerequest/RouteRequestMapperTest.java | 2 +- .../transmodel/mapping/TripRequestMapperTest.java | 2 +- .../module/OsmBoardingLocationsModuleTest.java | 2 +- .../graph_builder/module/StreetLinkerModuleTest.java | 2 +- .../graph_builder/module/TestStreetLinkerModule.java | 2 +- .../module/VehicleParkingLinkingTest.java | 6 +++--- .../module/islandpruning/IslandPruningUtils.java | 2 +- .../graph_builder/module/linking/LinkingTest.java | 2 +- .../graph_builder/module/osm/OsmModuleTest.java | 2 +- .../graph_builder/module/osm/PlatformLinkerTest.java | 2 +- .../module/osm/TriangleInequalityTest.java | 2 +- .../module/osm/UnconnectedAreasTest.java | 2 +- .../graph_builder/module/osm/UnroutableTest.java | 2 +- .../netex/mapping/VehicleParkingMapperTest.java | 4 ++-- .../routing/algorithm/GraphRoutingTest.java | 6 +++--- .../routing/graph/GraphSerializationTest.java | 2 +- .../routing/graphfinder/StreetGraphFinderTest.java | 2 +- .../vehicleparking}/VehicleParkingHelperTest.java | 6 ++++-- .../vehicleparking}/VehicleParkingTestGraphData.java | 2 +- .../vehicleparking}/VehicleParkingTestUtil.java | 4 +++- .../street/model/_data/StreetModelForTest.java | 2 +- .../model/edge/StreetVehicleParkingLinkTest.java | 4 ++-- .../street/model/edge/VehicleParkingEdgeTest.java | 4 ++-- .../model/edge/VehicleParkingPreferredTagsTest.java | 4 ++-- .../transit/speed_test/SpeedTest.java | 2 +- .../VehicleParkingAvailabilityUpdaterTest.java | 6 +++--- .../vehicle_parking/VehicleParkingUpdaterTest.java | 12 ++++++------ 107 files changed, 176 insertions(+), 171 deletions(-) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking}/VehicleParkingService.java (94%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParking.java (99%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingEntrance.java (98%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingGroup.java (97%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingGroupBuilder.java (93%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingHelper.java (98%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingSpaces.java (98%) rename application/src/main/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking/model}/VehicleParkingState.java (80%) rename application/src/test/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking}/VehicleParkingHelperTest.java (92%) rename application/src/test/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking}/VehicleParkingTestGraphData.java (96%) rename application/src/test/java/org/opentripplanner/{routing/vehicle_parking => service/vehicleparking}/VehicleParkingTestUtil.java (85%) diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java index bd0f2b8c37a..62df252538f 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java @@ -19,11 +19,11 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.standalone.config.routerconfig.VectorTileConfig; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.framework.FeedScopedId; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java index 376486c5e8b..c02d1bf9d6b 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java @@ -23,10 +23,10 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.standalone.config.routerconfig.VectorTileConfig; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.framework.Deduplicator; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdaterTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdaterTest.java index 569db85f33b..66e0a0fda9a 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdaterTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdaterTest.java @@ -8,7 +8,7 @@ import java.time.Duration; import java.util.Locale; import org.junit.jupiter.api.Test; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.test.support.ResourceLoader; import org.opentripplanner.transit.model.basic.Locales; import org.opentripplanner.transit.model.framework.FeedScopedId; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdaterTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdaterTest.java index 2226a988d20..fd584951586 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdaterTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdaterTest.java @@ -14,7 +14,7 @@ import org.opentripplanner._support.time.ZoneIds; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.model.calendar.openinghours.OsmOpeningHoursSupport; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.test.support.ResourceLoader; import org.opentripplanner.transit.model.framework.Deduplicator; diff --git a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java index fcf40a7b2f8..cf86f803aba 100644 --- a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java @@ -14,8 +14,8 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.graphfinder.DirectGraphFinder; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.standalone.api.OtpServerRequestContext; /** diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/PlaceMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/PlaceMapper.java index 28ceb0b84e3..059b0f93812 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/PlaceMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/PlaceMapper.java @@ -15,7 +15,7 @@ import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.StopArrival; import org.opentripplanner.model.plan.VehicleParkingWithEntrance; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.transit.model.site.RegularStop; public class PlaceMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java index aa072cfaed0..ba5dd39ea59 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java @@ -5,7 +5,7 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.ext.restapi.mapping.ModeMapper; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.model.WorldEnvelope; import org.opentripplanner.transit.service.TransitService; diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java index 40302032d4f..49a011eee77 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java @@ -5,7 +5,7 @@ import java.util.Set; import org.opentripplanner.api.parameter.ApiRequestMode; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.service.TransitService; diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java index 951552e1fdc..702fbac9e07 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java @@ -7,7 +7,7 @@ import org.opentripplanner.apis.support.mapping.PropertyMapper; import org.opentripplanner.framework.i18n.I18NStringMapper; import org.opentripplanner.inspector.vector.KeyValue; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; public class DigitransitVehicleParkingPropertyMapper extends PropertyMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/StadtnaviVehicleParkingPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/StadtnaviVehicleParkingPropertyMapper.java index bccc2b4de4d..8f745a4e633 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/StadtnaviVehicleParkingPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/StadtnaviVehicleParkingPropertyMapper.java @@ -9,8 +9,8 @@ import org.opentripplanner.framework.json.ObjectMappers; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.model.calendar.openinghours.OsmOpeningHoursSupport; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; public class StadtnaviVehicleParkingPropertyMapper extends PropertyMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingAndGroup.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingAndGroup.java index 7093dbb3407..5968f000d2d 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingAndGroup.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingAndGroup.java @@ -1,8 +1,8 @@ package org.opentripplanner.ext.vectortiles.layers.vehicleparkings; import java.util.Collection; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; /** * Record that holds {@link VehicleParkingGroup} and a set of {@link VehicleParking} that belong to diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java index a33cada7465..6df19d61a8a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java @@ -13,7 +13,7 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.inspector.vector.LayerBuilder; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; public class VehicleParkingGroupsLayerBuilder extends LayerBuilder { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java index 49e081d0039..40d9c97e4d7 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java @@ -16,8 +16,8 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.inspector.vector.LayerBuilder; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; public class VehicleParkingsLayerBuilder extends LayerBuilder { diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java index cd6a39fecd3..decbda7abf6 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java @@ -7,9 +7,9 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.json.ObjectMappers; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.GenericJsonDataSource; import org.opentripplanner.utils.tostring.ToStringBuilder; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdater.java index 2bed1121913..eba0547dbf5 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikely/BikelyUpdater.java @@ -1,6 +1,6 @@ package org.opentripplanner.ext.vehicleparking.bikely; -import static org.opentripplanner.routing.vehicle_parking.VehicleParkingState.OPERATIONAL; +import static org.opentripplanner.service.vehicleparking.model.VehicleParkingState.OPERATIONAL; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -17,9 +17,9 @@ import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientFactory; import org.opentripplanner.framework.json.ObjectMappers; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.transit.model.basic.LocalizedMoney; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.framework.FeedScopedId; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslFacilitiesDownloader.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslFacilitiesDownloader.java index dcf4ffe29d9..3d6c1943061 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslFacilitiesDownloader.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslFacilitiesDownloader.java @@ -13,8 +13,8 @@ import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientException; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubToVehicleParkingGroupMapper.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubToVehicleParkingGroupMapper.java index 1ef0ef3597b..2c4dcad73d6 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubToVehicleParkingGroupMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubToVehicleParkingGroupMapper.java @@ -13,7 +13,7 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.i18n.TranslatedString; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubsDownloader.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubsDownloader.java index f1f98b6139c..62e76b65035 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubsDownloader.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslHubsDownloader.java @@ -12,7 +12,7 @@ import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientException; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkToVehicleParkingMapper.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkToVehicleParkingMapper.java index 1f69458dd1f..c3e74f7285e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkToVehicleParkingMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkToVehicleParkingMapper.java @@ -19,10 +19,10 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OHCalendar; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdater.java index f5c5b33ef29..7933e968537 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/hslpark/HslParkUpdater.java @@ -6,10 +6,10 @@ import org.opentripplanner.framework.io.JsonDataListDownloader; import org.opentripplanner.framework.io.OtpHttpClientFactory; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingGroup; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces.VehicleParkingSpacesBuilder; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces.VehicleParkingSpacesBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.DataSource; import org.slf4j.Logger; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/BicycleParkAPIUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/BicycleParkAPIUpdater.java index 21898bc3956..76fd73d3c18 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/BicycleParkAPIUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/BicycleParkAPIUpdater.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; /** * Vehicle parking updater class that extends the {@link ParkAPIUpdater}. Meant for reading bicycle diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/CarParkAPIUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/CarParkAPIUpdater.java index 445f6bfbda3..06064f4896a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/CarParkAPIUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/CarParkAPIUpdater.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; /** * Vehicle parking updater class that extends the {@link ParkAPIUpdater}. Meant for reading car diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java index c7bd6631a48..3e206fc660d 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java @@ -15,9 +15,9 @@ import org.opentripplanner.model.calendar.openinghours.OHCalendar; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.osm.OsmOpeningHoursParser; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.GenericJsonDataSource; import org.opentripplanner.utils.tostring.ToStringBuilder; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java index c3f9fc0656a..c3ca214b62f 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java @@ -4,8 +4,8 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.fares.FareService; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.standalone.api.OtpServerRequestContext; import org.opentripplanner.transit.service.TransitService; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BikeParkImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BikeParkImpl.java index 81166034ee5..725d6e49377 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BikeParkImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BikeParkImpl.java @@ -6,7 +6,7 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.framework.graphql.GraphQLUtils; import org.opentripplanner.model.calendar.openinghours.OHCalendar; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; public class BikeParkImpl implements GraphQLDataFetchers.GraphQLBikePark { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/CarParkImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/CarParkImpl.java index ff990b4f65c..8947f589ca5 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/CarParkImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/CarParkImpl.java @@ -6,7 +6,7 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.framework.graphql.GraphQLUtils; import org.opentripplanner.model.calendar.openinghours.OHCalendar; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; public class CarParkImpl implements GraphQLDataFetchers.GraphQLCarPark { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/NodeTypeResolver.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/NodeTypeResolver.java index 437d75e03e9..bb105be08fb 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/NodeTypeResolver.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/NodeTypeResolver.java @@ -12,7 +12,7 @@ import org.opentripplanner.routing.graphfinder.NearbyStop; import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.transit.model.network.Route; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceImpl.java index 145321f809c..abb3a607ab9 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceImpl.java @@ -11,7 +11,7 @@ import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.StopArrival; import org.opentripplanner.model.plan.VertexType; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceInterfaceTypeResolver.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceInterfaceTypeResolver.java index cb2bfc77c32..a1f08fe3dc9 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceInterfaceTypeResolver.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PlaceInterfaceTypeResolver.java @@ -5,7 +5,7 @@ import graphql.schema.GraphQLSchema; import graphql.schema.TypeResolver; import org.opentripplanner.routing.graphfinder.PatternAtStop; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.transit.model.site.RegularStop; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java index 221df2b8ec6..4f1400ab110 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java @@ -56,9 +56,8 @@ import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; import org.opentripplanner.routing.graphfinder.PlaceType; -import org.opentripplanner.routing.services.TransitAlertService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleParkingImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleParkingImpl.java index 0b55beac689..56bc62e2004 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleParkingImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleParkingImpl.java @@ -6,9 +6,9 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.framework.graphql.GraphQLUtils; import org.opentripplanner.model.calendar.openinghours.OHCalendar; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; public class VehicleParkingImpl implements GraphQLDataFetchers.GraphQLVehicleParking { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java b/application/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java index 7532faf28bd..87118c5efcc 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java @@ -48,11 +48,11 @@ import org.opentripplanner.routing.graphfinder.NearbyStop; import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle.StopRelationship; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/BikeParkType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/BikeParkType.java index 470111513bf..8a9c965f4a2 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/BikeParkType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/BikeParkType.java @@ -6,7 +6,7 @@ import graphql.schema.GraphQLNonNull; import graphql.schema.GraphQLObjectType; import org.opentripplanner.apis.transmodel.mapping.TransitIdMapper; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; public class BikeParkType { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceInterfaceType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceInterfaceType.java index 0b6238c119d..f05113f9f74 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceInterfaceType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceInterfaceType.java @@ -5,7 +5,7 @@ import graphql.schema.GraphQLInterfaceType; import graphql.schema.GraphQLNonNull; import graphql.schema.GraphQLSchema; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.transit.model.site.RegularStop; diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java index 90ba7156cd6..8e34470ed6a 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/support/GqlUtil.java @@ -12,7 +12,7 @@ import org.opentripplanner.apis.transmodel.mapping.TransitIdMapper; import org.opentripplanner.framework.graphql.GraphQLUtils; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.transit.service.TransitService; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java index 324a56bd18b..104a75593fa 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java @@ -18,7 +18,7 @@ import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.graph_builder.module.configure.DaggerGraphBuilderFactory; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideEntranceRemoved.java b/application/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideEntranceRemoved.java index 122f99ba488..0170d554358 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideEntranceRemoved.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideEntranceRemoved.java @@ -3,7 +3,7 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; public record ParkAndRideEntranceRemoved(VehicleParkingEntrance vehicleParkingEntrance) implements DataImportIssue { diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 1a299aa9141..eadad8dc9b4 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -11,9 +11,9 @@ import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetStationCentroidLink; import org.opentripplanner.street.model.edge.StreetTransitEntranceLink; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java index da7ce85b647..8b95ce5d283 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java @@ -30,7 +30,7 @@ import org.opentripplanner.gtfs.graphbuilder.GtfsModule; import org.opentripplanner.netex.NetexModule; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java index cb063129b68..3cec9aaf7bf 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java @@ -43,7 +43,7 @@ import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.api.request.preference.WalkPreferences; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.transit.service.TimetableRepository; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index 64f8a4ec4b3..b026171f557 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -25,8 +25,8 @@ import org.opentripplanner.osm.wayproperty.WayProperties; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.util.ElevationUtils; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.edge.StreetEdge; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java index aa97408ba66..1f66fa65308 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java @@ -8,7 +8,7 @@ import org.opentripplanner.graph_builder.services.osm.EdgeNamer; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.StreetLimitationParameters; /** diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java index f372f0c82e2..60655eeccc5 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java @@ -24,9 +24,9 @@ import org.opentripplanner.osm.model.OsmNode; import org.opentripplanner.osm.model.OsmWithTags; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.edge.VehicleParkingEdge; diff --git a/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java b/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java index de700486c77..c1f0070eb86 100644 --- a/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java +++ b/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java @@ -9,8 +9,8 @@ import java.util.Set; import org.opentripplanner.apis.support.mapping.PropertyMapper; import org.opentripplanner.inspector.vector.KeyValue; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.vertex.BarrierVertex; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; diff --git a/application/src/main/java/org/opentripplanner/model/impl/OtpTransitServiceBuilder.java b/application/src/main/java/org/opentripplanner/model/impl/OtpTransitServiceBuilder.java index 3dd4a3db992..2b270e8afa4 100644 --- a/application/src/main/java/org/opentripplanner/model/impl/OtpTransitServiceBuilder.java +++ b/application/src/main/java/org/opentripplanner/model/impl/OtpTransitServiceBuilder.java @@ -26,7 +26,7 @@ import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.model.transfer.TransferPoint; import org.opentripplanner.routing.api.request.framework.TimePenalty; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.transit.model.basic.Notice; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.DefaultEntityById; diff --git a/application/src/main/java/org/opentripplanner/model/plan/VehicleParkingWithEntrance.java b/application/src/main/java/org/opentripplanner/model/plan/VehicleParkingWithEntrance.java index 5d28bcd02f2..131ef4cad7c 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/VehicleParkingWithEntrance.java +++ b/application/src/main/java/org/opentripplanner/model/plan/VehicleParkingWithEntrance.java @@ -1,7 +1,7 @@ package org.opentripplanner.model.plan; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; public class VehicleParkingWithEntrance { diff --git a/application/src/main/java/org/opentripplanner/netex/NetexModule.java b/application/src/main/java/org/opentripplanner/netex/NetexModule.java index 199b05f626b..7d0dcbe0335 100644 --- a/application/src/main/java/org/opentripplanner/netex/NetexModule.java +++ b/application/src/main/java/org/opentripplanner/netex/NetexModule.java @@ -13,8 +13,8 @@ import org.opentripplanner.model.calendar.ServiceDateInterval; import org.opentripplanner.model.impl.OtpTransitServiceBuilder; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; diff --git a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java index 4510aa0f099..47a51d580f4 100644 --- a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java +++ b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java @@ -11,7 +11,7 @@ import org.opentripplanner.netex.config.NetexFeedParameters; import org.opentripplanner.netex.loader.NetexDataSourceHierarchy; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; diff --git a/application/src/main/java/org/opentripplanner/netex/mapping/VehicleParkingMapper.java b/application/src/main/java/org/opentripplanner/netex/mapping/VehicleParkingMapper.java index 862c5f0c648..f29d9760077 100644 --- a/application/src/main/java/org/opentripplanner/netex/mapping/VehicleParkingMapper.java +++ b/application/src/main/java/org/opentripplanner/netex/mapping/VehicleParkingMapper.java @@ -9,8 +9,8 @@ import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.rutebanken.netex.model.Parking; import org.rutebanken.netex.model.ParkingVehicleEnumeration; diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java index 5f34dc4e1a7..c03d8d18bea 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java @@ -4,7 +4,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.utils.tostring.ToStringBuilder; /** diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingSelect.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingSelect.java index 2d3935461d4..d30f0c6795d 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingSelect.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingSelect.java @@ -2,7 +2,7 @@ import java.util.Collections; import java.util.Set; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; /** * A set of conditions that can be used to check if a parking facility should be included/excluded diff --git a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java index b518a47eedf..60fbb595c5c 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java @@ -25,7 +25,7 @@ import org.opentripplanner.model.projectinfo.GraphFileHeader; import org.opentripplanner.model.projectinfo.OtpProjectInfo; import org.opentripplanner.routing.graph.kryosupport.KryoBuilder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.standalone.config.RouterConfig; diff --git a/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java b/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java index 16420a0d9eb..8a4181d4b61 100644 --- a/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java +++ b/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java @@ -6,7 +6,7 @@ import java.util.Set; import org.opentripplanner.astar.spi.SkipEdgeStrategy; import org.opentripplanner.astar.spi.TraverseVisitor; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.edge.Edge; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java similarity index 94% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java index 7348caf7589..04858c1323f 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; @@ -9,6 +9,8 @@ import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; /** * Service that holds all the {@link VehicleParking} instances and an index for fetching parking diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParking.java similarity index 99% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParking.java index 4e71ecd1c68..c9539f21eef 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParking.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import java.io.Serializable; import java.util.ArrayList; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingEntrance.java similarity index 98% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingEntrance.java index f6bc584fb18..d905441641b 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingEntrance.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import java.io.Serializable; import java.util.Objects; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroup.java similarity index 97% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroup.java index 74ffedc0dcb..07548efa11a 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroup.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import java.util.Objects; import javax.annotation.Nullable; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroupBuilder.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroupBuilder.java similarity index 93% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroupBuilder.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroupBuilder.java index 42603e33159..7f109f38002 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroupBuilder.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingGroupBuilder.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelper.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingHelper.java similarity index 98% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelper.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingHelper.java index 257f2805ca2..5832a8d5f91 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelper.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingHelper.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import java.util.List; import java.util.Objects; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingSpaces.java similarity index 98% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingSpaces.java index eb50440651b..6827e6af198 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingSpaces.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; import java.io.Serializable; import java.util.Objects; diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingState.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingState.java similarity index 80% rename from application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingState.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingState.java index ff9178a9b34..e3af795459c 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingState.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/model/VehicleParkingState.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking.model; /** * The state of the vehicle parking. TEMPORARILY_CLOSED and CLOSED are distinct states so that they diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index 3ad83462612..b5b39ddee18 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -22,8 +22,8 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; import org.opentripplanner.standalone.config.routerconfig.VectorTileConfig; diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index a7baa345e36..64a63cf84af 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -18,8 +18,8 @@ import org.opentripplanner.routing.algorithm.raptoradapter.transit.mappers.TransitLayerMapper; import org.opentripplanner.routing.algorithm.raptoradapter.transit.mappers.TransitLayerUpdater; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.api.OtpServerRequestContext; diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index 9af2f99c436..9a484dec5c3 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -18,11 +18,11 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleRepositoryModule; import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleServiceModule; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.configure.VehicleRentalRepositoryModule; diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java index 5b748a310bc..bbdd39c57d5 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java @@ -15,8 +15,8 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; import org.opentripplanner.standalone.api.OtpServerRequestContext; diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java index 4cc774fc7ec..8fc7176a134 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java @@ -8,7 +8,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.CommandLineParameters; import org.opentripplanner.standalone.config.ConfigModel; diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java index 7d5ee01c72f..5e959cd9f0d 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java @@ -11,7 +11,7 @@ import org.opentripplanner.ext.stopconsolidation.configure.StopConsolidationRepositoryModule; import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.configure.WorldEnvelopeRepositoryModule; import org.opentripplanner.standalone.config.CommandLineParameters; diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 1e906a507d3..1427dcf1971 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -20,8 +20,8 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.service.DefaultRoutingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; import org.opentripplanner.standalone.api.HttpRequestScoped; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java index 682aeca0b3e..ac046dd45df 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java @@ -4,7 +4,7 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.street.model.vertex.StreetVertex; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.search.TraverseMode; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java index 95d9ea5507d..a7aa7bb2535 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java @@ -8,7 +8,7 @@ import org.opentripplanner.routing.api.request.preference.CarPreferences; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.street.search.request.StreetSearchRequest; diff --git a/application/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java b/application/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java index 591f71f1869..9a4e64dc2d6 100644 --- a/application/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java +++ b/application/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java @@ -3,8 +3,8 @@ import java.util.Collection; import java.util.Objects; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; diff --git a/application/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java b/application/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java index 80bd8021309..422fc16c837 100644 --- a/application/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java +++ b/application/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java @@ -6,8 +6,8 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.osm.model.OsmNode; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.edge.StreetEdge; diff --git a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java index a51599f2f33..3be06edd7e2 100644 --- a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java +++ b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java @@ -11,8 +11,8 @@ import org.opentripplanner.model.TimetableSnapshot; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.updater.DefaultRealTimeUpdateContext; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java index b23f46522c3..03c820a58e4 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java @@ -4,9 +4,9 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.GraphWriterRunnable; import org.opentripplanner.updater.RealTimeUpdateContext; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingDataSourceFactory.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingDataSourceFactory.java index ef587cd2b68..d7dd8f23c5f 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingDataSourceFactory.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingDataSourceFactory.java @@ -10,7 +10,7 @@ import org.opentripplanner.ext.vehicleparking.parkapi.CarParkAPIUpdater; import org.opentripplanner.ext.vehicleparking.parkapi.ParkAPIUpdaterParameters; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.updater.spi.DataSource; /** diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java index 830429151b4..d4b8e8b7b71 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java @@ -12,10 +12,10 @@ import org.opentripplanner.routing.linking.DisposableEdgeCollection; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; diff --git a/application/src/test/java/org/opentripplanner/ConstantsForTests.java b/application/src/test/java/org/opentripplanner/ConstantsForTests.java index b1d1080043c..01df4b4d933 100644 --- a/application/src/test/java/org/opentripplanner/ConstantsForTests.java +++ b/application/src/test/java/org/opentripplanner/ConstantsForTests.java @@ -31,7 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink; diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index 4efc74901e5..91071ef9df9 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -9,9 +9,9 @@ import org.opentripplanner.ext.emissions.EmissionsService; import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 5d12b85a45b..eaaa91aa0b9 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -68,10 +68,10 @@ import org.opentripplanner.routing.graphfinder.PlaceType; import org.opentripplanner.routing.impl.TransitAlertServiceImpl; import org.opentripplanner.routing.services.TransitAlertService; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.vehiclerental.model.TestFreeFloatingRentalVehicleBuilder; import org.opentripplanner.service.vehiclerental.model.TestVehicleRentalStationBuilder; diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java index eb184f17c9d..28dd7364306 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java @@ -34,8 +34,8 @@ import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java index 521ed211b7a..ca1cf9f0ee3 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java @@ -30,8 +30,8 @@ import org.opentripplanner.routing.api.request.preference.ItineraryFilterDebugProfile; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.service.DefaultTransitService; diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 141e8d2c818..9218037414b 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -46,8 +46,8 @@ import org.opentripplanner.routing.api.request.via.ViaLocation; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeService; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java index 3ac86be3fba..d1b997dc976 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java @@ -14,7 +14,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.edge.BoardingLocationToStopLink; import org.opentripplanner.street.model.edge.Edge; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 407d2f630c7..1c301a0b8cb 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -18,7 +18,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetTransitStopLink; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index 7333a98afe1..7418ad8c626 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -2,7 +2,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.transit.service.TimetableRepository; public class TestStreetLinkerModule { diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index 42f016055be..e5c52e1dea8 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -9,9 +9,9 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingTestGraphData; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java index fcd76fc5e0a..fc7f0fa2031 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java @@ -5,7 +5,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.service.SiteRepository; import org.opentripplanner.transit.service.TimetableRepository; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java index e4bb6f4ad9e..c154d27ad93 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetEdge; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index a9ac1a10e54..100420e9130 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -32,7 +32,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.impl.GraphPathFinder; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.vertex.BarrierVertex; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java index b72dceb5814..a0b2e843816 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java index 1778e7306b5..edf6a6fe297 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.routing.api.request.request.filter.AllowAllTransitFilter; import org.opentripplanner.routing.api.request.request.filter.TransitFilter; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java index 8c98261340c..72b1ae6d374 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java @@ -13,7 +13,7 @@ import org.opentripplanner.graph_builder.module.TestStreetLinkerModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java index 17b29a1585f..291e3475b74 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java @@ -10,7 +10,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; diff --git a/application/src/test/java/org/opentripplanner/netex/mapping/VehicleParkingMapperTest.java b/application/src/test/java/org/opentripplanner/netex/mapping/VehicleParkingMapperTest.java index bf56be1be1b..d803e1867cb 100644 --- a/application/src/test/java/org/opentripplanner/netex/mapping/VehicleParkingMapperTest.java +++ b/application/src/test/java/org/opentripplanner/netex/mapping/VehicleParkingMapperTest.java @@ -22,8 +22,8 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issue.service.DefaultDataImportIssueStore; import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.rutebanken.netex.model.LocationStructure; import org.rutebanken.netex.model.MultilingualString; import org.rutebanken.netex.model.Parking; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/GraphRoutingTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/GraphRoutingTest.java index b9f9d7acb56..e283e4e9fa8 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/GraphRoutingTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/GraphRoutingTest.java @@ -13,9 +13,9 @@ import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParking.VehicleParkingEntranceCreator; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking.VehicleParkingEntranceCreator; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index d9d7f178c29..2f5f70da908 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -23,7 +23,7 @@ import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; diff --git a/application/src/test/java/org/opentripplanner/routing/graphfinder/StreetGraphFinderTest.java b/application/src/test/java/org/opentripplanner/routing/graphfinder/StreetGraphFinderTest.java index 622b76a431a..2c787bc682c 100644 --- a/application/src/test/java/org/opentripplanner/routing/graphfinder/StreetGraphFinderTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graphfinder/StreetGraphFinderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.routing.algorithm.GraphRoutingTest; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.vertex.IntersectionVertex; diff --git a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelperTest.java b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingHelperTest.java similarity index 92% rename from application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelperTest.java rename to application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingHelperTest.java index 90bdeb015a4..34b48bfe051 100644 --- a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingHelperTest.java +++ b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingHelperTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -9,7 +9,9 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking.VehicleParkingEntranceCreator; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking.VehicleParkingEntranceCreator; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; diff --git a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestGraphData.java b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestGraphData.java similarity index 96% rename from application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestGraphData.java rename to application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestGraphData.java index 03c4981f181..b2a847d267d 100644 --- a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestGraphData.java +++ b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestGraphData.java @@ -1,4 +1,4 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.street.model.StreetTraversalPermission; diff --git a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestUtil.java b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestUtil.java similarity index 85% rename from application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestUtil.java rename to application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestUtil.java index fca20322ebe..aebd422cf81 100644 --- a/application/src/test/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingTestUtil.java +++ b/application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestUtil.java @@ -1,7 +1,9 @@ -package org.opentripplanner.routing.vehicle_parking; +package org.opentripplanner.service.vehicleparking; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.transit.model.framework.FeedScopedId; diff --git a/application/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java b/application/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java index 8d06e06a0c1..08710fe0599 100644 --- a/application/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java +++ b/application/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java @@ -8,7 +8,7 @@ import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.model.TestFreeFloatingRentalVehicleBuilder; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.RentalFormFactor; diff --git a/application/src/test/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLinkTest.java b/application/src/test/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLinkTest.java index 8c6127e716e..a44bed87bdf 100644 --- a/application/src/test/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLinkTest.java +++ b/application/src/test/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLinkTest.java @@ -16,8 +16,8 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.routing.api.request.StreetMode; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.model.vertex.Vertex; diff --git a/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingEdgeTest.java b/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingEdgeTest.java index e28bf75583d..4fa7f682dfb 100644 --- a/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingEdgeTest.java +++ b/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingEdgeTest.java @@ -8,8 +8,8 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.routing.api.request.StreetMode; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.search.request.StreetSearchRequest; diff --git a/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingPreferredTagsTest.java b/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingPreferredTagsTest.java index 579ae4e964d..2f18f02b89b 100644 --- a/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingPreferredTagsTest.java +++ b/application/src/test/java/org/opentripplanner/street/model/edge/VehicleParkingPreferredTagsTest.java @@ -11,8 +11,8 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.routing.api.request.StreetMode; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingEntrance; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.model.vertex.Vertex; diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index 29d5d27fb3d..1366f85c788 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -22,8 +22,8 @@ import org.opentripplanner.routing.framework.DebugTimingAggregator; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.standalone.OtpStartupInfo; import org.opentripplanner.standalone.api.OtpServerRequestContext; diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index 27b6a038418..1a8ffb563ed 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -12,9 +12,9 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.standalone.config.routerconfig.updaters.VehicleParkingUpdaterConfig; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.service.TimetableRepository; diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index 2f09fca8216..b3ea76928c6 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingTestGraphData; -import org.opentripplanner.routing.vehicle_parking.VehicleParkingTestUtil; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; +import org.opentripplanner.service.vehicleparking.VehicleParkingTestUtil; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; From 33d148c9dcdec55820fe147e11fb90ffa069ccdc Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 10 Nov 2024 09:58:11 +0100 Subject: [PATCH 07/55] Extract interface for parking service --- .../VehicleParkingGroupsLayerTest.java | 3 +- .../VehicleParkingsLayerTest.java | 3 +- .../vehicleparking/VehicleParkingService.java | 89 ++------------- .../VehicleParkingServiceModule.java | 12 ++ .../DefaultVehicleParkingService.java | 107 ++++++++++++++++++ .../configure/LoadApplicationFactory.java | 2 + .../opentripplanner/ConstantsForTests.java | 10 +- .../opentripplanner/TestServerContext.java | 3 +- .../apis/gtfs/GraphQLIntegrationTest.java | 3 +- .../LegacyRouteRequestMapperTest.java | 4 +- .../routerequest/RouteRequestMapperTest.java | 4 +- .../mapping/TripRequestMapperTest.java | 4 +- .../OsmBoardingLocationsModuleTest.java | 4 +- .../module/StreetLinkerModuleTest.java | 4 +- .../module/TestStreetLinkerModule.java | 3 +- .../module/VehicleParkingLinkingTest.java | 4 +- .../islandpruning/IslandPruningUtils.java | 4 +- .../module/linking/LinkingTest.java | 4 +- .../module/osm/OsmModuleTest.java | 11 +- .../module/osm/PlatformLinkerTest.java | 4 +- .../module/osm/TriangleInequalityTest.java | 4 +- .../module/osm/UnconnectedAreasTest.java | 4 +- .../module/osm/UnroutableTest.java | 4 +- .../routing/graph/GraphSerializationTest.java | 5 +- .../transit/speed_test/SpeedTest.java | 4 +- ...VehicleParkingAvailabilityUpdaterTest.java | 3 +- .../VehicleParkingUpdaterTest.java | 3 +- 27 files changed, 185 insertions(+), 124 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java create mode 100644 application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java index 62df252538f..c7134c1ca31 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java @@ -19,6 +19,7 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.inspector.vector.LayerParameters; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -89,7 +90,7 @@ public void setUp() { @Test public void vehicleParkingGroupGeometryTest() { - VehicleParkingService service = new VehicleParkingService(); + VehicleParkingService service = new DefaultVehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java index c02d1bf9d6b..112c3e70571 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java @@ -23,6 +23,7 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; @@ -85,7 +86,7 @@ public void setUp() { @Test public void vehicleParkingGeometryTest() { - VehicleParkingService service = new VehicleParkingService(); + VehicleParkingService service = new DefaultVehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java index 04858c1323f..753d390d2c2 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java @@ -1,97 +1,26 @@ package org.opentripplanner.service.vehicleparking; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; -import com.google.common.collect.Multimap; -import jakarta.inject.Inject; -import java.io.Serializable; import java.util.Collection; -import java.util.HashSet; -import java.util.Set; import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; -/** - * Service that holds all the {@link VehicleParking} instances and an index for fetching parking - * locations within a {@link VehicleParkingGroup}. This class is thread-safe because the collections - * held here are immutable and only updated in atomic operations that replace the existing - * collection with a new copy. - * - *

THIS CLASS IS THREAD-SAFE

- */ -public class VehicleParkingService implements Serializable { - - @Inject - public VehicleParkingService() {} - - /** - * To ensure that his is thread-safe, the set stored here should always be immutable. - *

- * The volatile keyword is used to ensure safe publication by clearing CPU caches. - */ - private volatile Set vehicleParkings = Set.of(); - - /** - * To ensure that his is thread-safe, {@link ImmutableListMultimap} is used. - *

- * The volatile keyword is used to ensure safe publication by clearing CPU caches. - */ - private volatile ImmutableListMultimap vehicleParkingGroups = ImmutableListMultimap.of(); - - /** - * Does atomic update of {@link VehicleParking} and index of {@link VehicleParkingGroup} in this - * service by replacing the existing with a new copy that includes old ones that were not removed - * in the update and the new ones that were added in the update. - */ - public void updateVehicleParking( +public interface VehicleParkingService { + void updateVehicleParking( Collection parkingToAdd, Collection parkingToRemove - ) { - Multimap updatedVehicleParkingGroups = ArrayListMultimap.create( - vehicleParkingGroups - ); - parkingToRemove.forEach(vehicleParking -> { - var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); - if (vehicleParkingGroup != null) { - updatedVehicleParkingGroups.remove(vehicleParking.getVehicleParkingGroup(), vehicleParking); - } - }); - parkingToAdd.forEach(vehicleParking -> { - var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); - if (vehicleParkingGroup != null) { - updatedVehicleParkingGroups.put(vehicleParking.getVehicleParkingGroup(), vehicleParking); - } - }); - vehicleParkingGroups = ImmutableListMultimap.copyOf(updatedVehicleParkingGroups); - - Set updatedVehicleParkings = new HashSet<>(vehicleParkings); - updatedVehicleParkings.removeAll(parkingToRemove); - updatedVehicleParkings.addAll(parkingToAdd); - vehicleParkings = Set.copyOf(updatedVehicleParkings); - } + ); - public Stream getBikeParks() { - return vehicleParkings.stream().filter(VehicleParking::hasBicyclePlaces); - } + Stream getBikeParks(); - public Stream getCarParks() { - return vehicleParkings.stream().filter(VehicleParking::hasAnyCarPlaces); - } + Stream getCarParks(); - public Stream getVehicleParkings() { - return vehicleParkings.stream(); - } + Stream getVehicleParkings(); - public ImmutableListMultimap getVehicleParkingGroups() { - return vehicleParkingGroups; - } + ImmutableListMultimap getVehicleParkingGroups(); - public boolean hasBikeParking() { - return vehicleParkings.stream().anyMatch(VehicleParking::hasBicyclePlaces); - } + boolean hasBikeParking(); - public boolean hasCarParking() { - return vehicleParkings.stream().anyMatch(VehicleParking::hasAnyCarPlaces); - } + boolean hasCarParking(); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java new file mode 100644 index 00000000000..8b6cb3af7c7 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java @@ -0,0 +1,12 @@ +package org.opentripplanner.service.vehicleparking.configure; + +import dagger.Binds; +import dagger.Module; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; + +@Module +public interface VehicleParkingServiceModule { + @Binds + VehicleParkingService bindService(DefaultVehicleParkingService service); +} diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java new file mode 100644 index 00000000000..7c860dd5d94 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -0,0 +1,107 @@ +package org.opentripplanner.service.vehicleparking.internal; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.Multimap; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import java.io.Serializable; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Stream; +import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; + +/** + * Service that holds all the {@link VehicleParking} instances and an index for fetching parking + * locations within a {@link VehicleParkingGroup}. This class is thread-safe because the collections + * held here are immutable and only updated in atomic operations that replace the existing + * collection with a new copy. + * + *

THIS CLASS IS THREAD-SAFE

+ */ +@Singleton +public class DefaultVehicleParkingService implements Serializable, VehicleParkingService { + + @Inject + public DefaultVehicleParkingService() {} + + /** + * To ensure that his is thread-safe, the set stored here should always be immutable. + *

+ * The volatile keyword is used to ensure safe publication by clearing CPU caches. + */ + private volatile Set vehicleParkings = Set.of(); + + /** + * To ensure that his is thread-safe, {@link ImmutableListMultimap} is used. + *

+ * The volatile keyword is used to ensure safe publication by clearing CPU caches. + */ + private volatile ImmutableListMultimap vehicleParkingGroups = ImmutableListMultimap.of(); + + /** + * Does atomic update of {@link VehicleParking} and index of {@link VehicleParkingGroup} in this + * service by replacing the existing with a new copy that includes old ones that were not removed + * in the update and the new ones that were added in the update. + */ + @Override + public void updateVehicleParking( + Collection parkingToAdd, + Collection parkingToRemove + ) { + Multimap updatedVehicleParkingGroups = ArrayListMultimap.create( + vehicleParkingGroups + ); + parkingToRemove.forEach(vehicleParking -> { + var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); + if (vehicleParkingGroup != null) { + updatedVehicleParkingGroups.remove(vehicleParking.getVehicleParkingGroup(), vehicleParking); + } + }); + parkingToAdd.forEach(vehicleParking -> { + var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); + if (vehicleParkingGroup != null) { + updatedVehicleParkingGroups.put(vehicleParking.getVehicleParkingGroup(), vehicleParking); + } + }); + vehicleParkingGroups = ImmutableListMultimap.copyOf(updatedVehicleParkingGroups); + + Set updatedVehicleParkings = new HashSet<>(vehicleParkings); + updatedVehicleParkings.removeAll(parkingToRemove); + updatedVehicleParkings.addAll(parkingToAdd); + vehicleParkings = Set.copyOf(updatedVehicleParkings); + } + + @Override + public Stream getBikeParks() { + return vehicleParkings.stream().filter(VehicleParking::hasBicyclePlaces); + } + + @Override + public Stream getCarParks() { + return vehicleParkings.stream().filter(VehicleParking::hasAnyCarPlaces); + } + + @Override + public Stream getVehicleParkings() { + return vehicleParkings.stream(); + } + + @Override + public ImmutableListMultimap getVehicleParkingGroups() { + return vehicleParkingGroups; + } + + @Override + public boolean hasBikeParking() { + return vehicleParkings.stream().anyMatch(VehicleParking::hasBicyclePlaces); + } + + @Override + public boolean hasCarParking() { + return vehicleParkings.stream().anyMatch(VehicleParking::hasAnyCarPlaces); + } +} diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java index 5e959cd9f0d..e269393e039 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java @@ -12,6 +12,7 @@ import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.configure.VehicleParkingServiceModule; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.configure.WorldEnvelopeRepositoryModule; import org.opentripplanner.standalone.config.CommandLineParameters; @@ -31,6 +32,7 @@ GsDataSourceModule.class, WorldEnvelopeRepositoryModule.class, StopConsolidationRepositoryModule.class, + VehicleParkingServiceModule.class, } ) public interface LoadApplicationFactory { diff --git a/application/src/test/java/org/opentripplanner/ConstantsForTests.java b/application/src/test/java/org/opentripplanner/ConstantsForTests.java index 01df4b4d933..8f8eacd3d88 100644 --- a/application/src/test/java/org/opentripplanner/ConstantsForTests.java +++ b/application/src/test/java/org/opentripplanner/ConstantsForTests.java @@ -31,7 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink; @@ -136,7 +136,7 @@ public static TestOtpModel buildNewPortlandGraph(boolean withElevation) { { OsmProvider osmProvider = new OsmProvider(PORTLAND_CENTRAL_OSM, false); OsmModule osmModule = OsmModule - .of(osmProvider, graph, new VehicleParkingService()) + .of(osmProvider, graph, new DefaultVehicleParkingService()) .withStaticParkAndRide(true) .withStaticBikeParkAndRide(true) .build(); @@ -185,7 +185,9 @@ public static TestOtpModel buildOsmGraph(File osmFile) { var timetableRepository = new TimetableRepository(siteRepository, deduplicator); // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); - OsmModule osmModule = OsmModule.of(osmProvider, graph, new VehicleParkingService()).build(); + OsmModule osmModule = OsmModule + .of(osmProvider, graph, new DefaultVehicleParkingService()) + .build(); osmModule.buildGraph(); return new TestOtpModel(graph, timetableRepository); } catch (Exception e) { @@ -227,7 +229,7 @@ public static TestOtpModel buildNewMinimalNetexGraph() { try { var deduplicator = new Deduplicator(); var siteRepository = new SiteRepository(); - var parkingService = new VehicleParkingService(); + var parkingService = new DefaultVehicleParkingService(); var graph = new Graph(deduplicator); var timetableRepository = new TimetableRepository(siteRepository, deduplicator); // Add street data from OSM diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index 91071ef9df9..b9631593f27 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -11,6 +11,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; @@ -90,7 +91,7 @@ public static VehicleRentalService createVehicleRentalService() { } public static VehicleParkingService createVehicleParkingService() { - return new VehicleParkingService(); + return new DefaultVehicleParkingService(); } public static EmissionsService createEmissionsService() { diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index eaaa91aa0b9..e0930ad8cd5 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -70,6 +70,7 @@ import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; @@ -141,7 +142,7 @@ class GraphQLIntegrationTest { private static GraphQLRequestContext context; private static final Deduplicator DEDUPLICATOR = new Deduplicator(); - private static final VehicleParkingService parkingService = new VehicleParkingService(); + private static final VehicleParkingService parkingService = new DefaultVehicleParkingService(); @BeforeAll static void setup() { diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java index 28dd7364306..bf80f5f2185 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java @@ -35,7 +35,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; @@ -62,7 +62,7 @@ class LegacyRouteRequestMapperTest implements PlanTestConstants { transitService, new DefaultFareService(), new DefaultVehicleRentalService(), - new VehicleParkingService(), + new DefaultVehicleParkingService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java index ca1cf9f0ee3..618ad89f046 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java @@ -31,7 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.service.DefaultTransitService; @@ -72,7 +72,7 @@ class RouteRequestMapperTest { transitService, new DefaultFareService(), new DefaultVehicleRentalService(), - new VehicleParkingService(), + new DefaultVehicleParkingService(), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 9218037414b..67dbe5c18d9 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -47,7 +47,7 @@ import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeService; @@ -145,7 +145,7 @@ void setup() { new DefaultWorldEnvelopeService(new DefaultWorldEnvelopeRepository()), new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), - new VehicleParkingService(), + new DefaultVehicleParkingService(), new DefaultEmissionsService(new EmissionsDataModel()), null, RouterConfig.DEFAULT.flexParameters(), diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java index d1b997dc976..c7295640a18 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java @@ -14,7 +14,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.edge.BoardingLocationToStopLink; import org.opentripplanner.street.model.edge.Edge; @@ -84,7 +84,7 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVerti new NonLocalizedString("bus stop not connected to street network") ); var osmModule = OsmModule - .of(provider, graph, new VehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingService()) .withBoardingAreaRefTags(Set.of("ref", "ref:IFOPT")) .withAreaVisibility(areaVisibility) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 1c301a0b8cb..425fa186312 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -18,7 +18,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetTransitStopLink; @@ -174,7 +174,7 @@ public TestModel() { module = new StreetLinkerModule( graph, - new VehicleParkingService(), + new DefaultVehicleParkingService(), timetableRepository, DataImportIssueStore.NOOP, false diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index 7418ad8c626..0ed7edd6653 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -2,6 +2,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.transit.service.TimetableRepository; @@ -9,7 +10,7 @@ public class TestStreetLinkerModule { /** For test only */ public static void link(Graph graph, TimetableRepository timetableRepository) { - link(graph, new VehicleParkingService(), timetableRepository); + link(graph, new DefaultVehicleParkingService(), timetableRepository); } public static void link( diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index e5c52e1dea8..9d6fc3ee54b 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -170,7 +170,7 @@ public void removeVehicleParkingWithOneEntranceAndNonExistingVertexTest() { ) .build(); - var vehicleParkingService = new VehicleParkingService(); + var vehicleParkingService = new DefaultVehicleParkingService(); vehicleParkingService.updateVehicleParking(List.of(vehicleParking), List.of()); helper.linkVehicleParkingToGraph(vehicleParking); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java index fc7f0fa2031..e6ce7410ae6 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java @@ -5,7 +5,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.service.SiteRepository; import org.opentripplanner.transit.service.TimetableRepository; @@ -26,7 +26,7 @@ static Graph buildOsmGraph( // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); OsmModule osmModule = OsmModule - .of(osmProvider, graph, new VehicleParkingService()) + .of(osmProvider, graph, new DefaultVehicleParkingService()) .withEdgeNamer(new TestNamer()) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java index c154d27ad93..9f124e25ac9 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetEdge; @@ -158,7 +158,7 @@ public static TestOtpModel buildGraphNoTransit() { File file = ResourceLoader.of(LinkingTest.class).file("columbus.osm.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule osmModule = OsmModule.of(provider, gg, new VehicleParkingService()).build(); + OsmModule osmModule = OsmModule.of(provider, gg, new DefaultVehicleParkingService()).build(); osmModule.buildGraph(); return new TestOtpModel(gg, timetableRepository); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 100420e9130..49efdb6d47e 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -32,6 +32,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.impl.GraphPathFinder; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; @@ -58,7 +59,7 @@ public void testGraphBuilder() { OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, gg, new VehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingService()) .withAreaVisibility(true) .build(); @@ -117,7 +118,7 @@ public void testBuildGraphDetailed() { File file = RESOURCE_LOADER.file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, gg, new VehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingService()) .withAreaVisibility(true) .build(); @@ -313,7 +314,7 @@ void testBarrierAtEnd() { File file = RESOURCE_LOADER.file("accessno-at-end.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule loader = OsmModule.of(provider, graph, new VehicleParkingService()).build(); + OsmModule loader = OsmModule.of(provider, graph, new DefaultVehicleParkingService()).build(); loader.buildGraph(); Vertex start = graph.getVertex(VertexLabel.osm(1)); @@ -330,7 +331,7 @@ void testBarrierAtEnd() { private BuildResult buildParkingLots() { var graph = new Graph(); - var service = new VehicleParkingService(); + var service = new DefaultVehicleParkingService(); var providers = Stream .of("B+R.osm.pbf", "P+R.osm.pbf") .map(RESOURCE_LOADER::file) @@ -364,7 +365,7 @@ private void testBuildingAreas(boolean skipVisibility) { OsmProvider provider = new OsmProvider(file, false); OsmModule loader = OsmModule - .of(provider, graph, new VehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingService()) .withAreaVisibility(!skipVisibility) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java index a0b2e843816..5a63e4683b2 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -31,7 +31,7 @@ public void testLinkEntriesToPlatforms() { OsmProvider provider = new OsmProvider(file, false); OsmModule osmModule = OsmModule - .of(provider, gg, new VehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingService()) .withPlatformEntriesLinking(true) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java index edf6a6fe297..b81ecc6c6e5 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.routing.api.request.request.filter.AllowAllTransitFilter; import org.opentripplanner.routing.api.request.request.filter.TransitFilter; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -52,7 +52,7 @@ public static void onlyOnce() { File file = ResourceLoader.of(TriangleInequalityTest.class).file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, graph, new VehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingService()) .withAreaVisibility(true) .build(); osmModule.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java index 72b1ae6d374..7837f757b92 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java @@ -13,7 +13,7 @@ import org.opentripplanner.graph_builder.module.TestStreetLinkerModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; @@ -163,7 +163,7 @@ private Graph buildOsmGraph(String osmFileName, DataImportIssueStore issueStore) var timetableRepository = new TimetableRepository(siteRepository, deduplicator); OsmProvider provider = new OsmProvider(RESOURCE_LOADER.file(osmFileName), false); OsmModule loader = OsmModule - .of(provider, graph, new VehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingService()) .withIssueStore(issueStore) .withAreaVisibility(true) .withStaticParkAndRide(true) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java index 291e3475b74..5c898fe446e 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java @@ -10,7 +10,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -39,7 +39,7 @@ public void setUp() throws Exception { var osmDataFile = ResourceLoader.of(UnroutableTest.class).file("bridge_construction.osm.pbf"); OsmProvider provider = new OsmProvider(osmDataFile, true); OsmModule osmBuilder = OsmModule - .of(provider, graph, new VehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingService()) .withAreaVisibility(true) .build(); osmBuilder.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index 2f5f70da908..39350f01803 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -23,6 +23,7 @@ import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; @@ -68,7 +69,7 @@ public void testRoundTripSerializationForGTFSGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewPortlandGraph(true); var weRepo = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); - var parkingService = new VehicleParkingService(); + var parkingService = new DefaultVehicleParkingService(); testRoundTrip( model.graph(), model.timetableRepository(), @@ -86,7 +87,7 @@ public void testRoundTripSerializationForNetexGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewMinimalNetexGraph(); var worldEnvelopeRepository = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); - var parkingService = new VehicleParkingService(); + var parkingService = new DefaultVehicleParkingService(); testRoundTrip( model.graph(), model.timetableRepository(), diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index 1366f85c788..347262449cb 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -23,7 +23,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.standalone.OtpStartupInfo; import org.opentripplanner.standalone.api.OtpServerRequestContext; @@ -99,7 +99,7 @@ public SpeedTest( graph, new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), - new VehicleParkingService(), + new DefaultVehicleParkingService(), timetableRepository, config.updatersConfig ); diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index 1a8ffb563ed..451d8c6e77a 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -12,6 +12,7 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; @@ -95,7 +96,7 @@ void notFound() { } private static VehicleParkingService buildParkingService(VehicleParkingSpaces capacity) { - var service = new VehicleParkingService(); + var service = new DefaultVehicleParkingService(); var parking = parkingBuilder() .carPlaces(capacity.getCarSpaces() != null) diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index b3ea76928c6..81aea5ea8db 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; import org.opentripplanner.service.vehicleparking.VehicleParkingTestUtil; @@ -45,7 +46,7 @@ public void setup() { graphData.initGraph(); graph = graphData.getGraph(); timetableRepository = graphData.getTimetableRepository(); - vehicleParkingService = new VehicleParkingService(); + vehicleParkingService = new DefaultVehicleParkingService(); realTimeUpdateContext = new DefaultRealTimeUpdateContext(graph, timetableRepository); dataSource = (DataSource) Mockito.mock(DataSource.class); From a23ab8413b5b493a3e7649cf8fda6cccdb11203f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 10 Nov 2024 23:10:28 +0100 Subject: [PATCH 08/55] Split vehicle parking into service and repository --- .../VehicleParkingGroupsLayerTest.java | 4 +-- .../VehicleParkingsLayerTest.java | 3 +- .../graph_builder/GraphBuilder.java | 6 ++-- .../module/StreetLinkerModule.java | 10 +++--- .../module/configure/GraphBuilderFactory.java | 4 +-- .../module/configure/GraphBuilderModules.java | 14 ++++---- .../graph_builder/module/osm/OsmModule.java | 14 ++++---- .../module/osm/OsmModuleBuilder.java | 10 +++--- .../opentripplanner/netex/NetexModule.java | 10 +++--- .../netex/configure/NetexConfigure.java | 6 ++-- .../VehicleParkingRepository.java | 14 ++++++++ .../vehicleparking/VehicleParkingService.java | 11 +++---- ...eModule.java => VehicleParkingModule.java} | 8 +++-- .../DefaultVehicleParkingService.java | 4 ++- .../configure/ConstructApplication.java | 9 ++++-- .../ConstructApplicationFactory.java | 9 +++--- .../configure/LoadApplicationFactory.java | 4 +-- .../configure/UpdaterConfigurator.java | 25 +++++++++++---- .../VehicleParkingAvailabilityUpdater.java | 12 ++++--- .../VehicleParkingUpdater.java | 10 +++--- .../opentripplanner/TestServerContext.java | 2 +- .../apis/gtfs/GraphQLIntegrationTest.java | 3 +- .../module/TestStreetLinkerModule.java | 6 ++-- .../module/VehicleParkingLinkingTest.java | 2 +- .../module/osm/OsmModuleTest.java | 2 +- .../routing/graph/GraphSerializationTest.java | 2 +- .../transit/speed_test/SpeedTest.java | 1 + ...VehicleParkingAvailabilityUpdaterTest.java | 6 ++-- .../VehicleParkingUpdaterTest.java | 32 ++++++++----------- 29 files changed, 140 insertions(+), 103 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java rename application/src/main/java/org/opentripplanner/service/vehicleparking/configure/{VehicleParkingServiceModule.java => VehicleParkingModule.java} (63%) diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java index c7134c1ca31..06a6d7088a1 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java @@ -19,8 +19,8 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.inspector.vector.LayerParameters; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; @@ -90,7 +90,7 @@ public void setUp() { @Test public void vehicleParkingGroupGeometryTest() { - VehicleParkingService service = new DefaultVehicleParkingService(); + var service = new DefaultVehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java index 112c3e70571..4e4b5e507af 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java @@ -24,7 +24,6 @@ import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; @@ -86,7 +85,7 @@ public void setUp() { @Test public void vehicleParkingGeometryTest() { - VehicleParkingService service = new DefaultVehicleParkingService(); + var service = new DefaultVehicleParkingService(); service.updateVehicleParking(List.of(vehicleParking), List.of()); var config = diff --git a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java index 104a75593fa..6fad376e374 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java @@ -18,7 +18,7 @@ import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.graph_builder.module.configure.DaggerGraphBuilderFactory; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; @@ -64,7 +64,7 @@ public static GraphBuilder create( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository vehicleParkingService, @Nullable EmissionsDataModel emissionsDataModel, @Nullable StopConsolidationRepository stopConsolidationRepository, StreetLimitationParameters streetLimitationParameters, @@ -84,7 +84,7 @@ public static GraphBuilder create( .graph(graph) .timetableRepository(timetableRepository) .worldEnvelopeRepository(worldEnvelopeRepository) - .vehicleParkingService(vehicleParkingService) + .vehicleParkingRepository(vehicleParkingService) .stopConsolidationRepository(stopConsolidationRepository) .streetLimitationParameters(streetLimitationParameters) .dataSources(dataSources) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index eadad8dc9b4..83a6f282204 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -11,7 +11,7 @@ import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.edge.Edge; @@ -49,20 +49,20 @@ public class StreetLinkerModule implements GraphBuilderModule { private static final TraverseModeSet CAR_ONLY = new TraverseModeSet(TraverseMode.CAR); private static final TraverseModeSet WALK_ONLY = new TraverseModeSet(TraverseMode.WALK); private final Graph graph; - private final VehicleParkingService parkingService; + private final VehicleParkingRepository parkingRepository; private final TimetableRepository timetableRepository; private final DataImportIssueStore issueStore; private final Boolean addExtraEdgesToAreas; public StreetLinkerModule( Graph graph, - VehicleParkingService parkingService, + VehicleParkingRepository parkingRepository, TimetableRepository timetableRepository, DataImportIssueStore issueStore, boolean addExtraEdgesToAreas ) { this.graph = graph; - this.parkingService = parkingService; + this.parkingRepository = parkingRepository; this.timetableRepository = timetableRepository; this.issueStore = issueStore; this.addExtraEdgesToAreas = addExtraEdgesToAreas; @@ -314,7 +314,7 @@ private void linkVehicleParks(Graph graph, DataImportIssueStore issueStore) { } } if (!vehicleParkingToRemove.isEmpty()) { - parkingService.updateVehicleParking(List.of(), vehicleParkingToRemove); + parkingRepository.updateVehicleParking(List.of(), vehicleParkingToRemove); } } diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java index 8b95ce5d283..d4d00fdc2a0 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderFactory.java @@ -30,7 +30,7 @@ import org.opentripplanner.gtfs.graphbuilder.GtfsModule; import org.opentripplanner.netex.NetexModule; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; @@ -89,7 +89,7 @@ Builder stopConsolidationRepository( ); @BindsInstance - Builder vehicleParkingService(VehicleParkingService parkingService); + Builder vehicleParkingRepository(VehicleParkingRepository parkingRepository); @BindsInstance Builder streetLimitationParameters(StreetLimitationParameters streetLimitationParameters); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java index 3cec9aaf7bf..5371142d612 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/configure/GraphBuilderModules.java @@ -43,7 +43,7 @@ import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.api.request.preference.WalkPreferences; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.transit.service.TimetableRepository; @@ -60,7 +60,7 @@ static OsmModule provideOsmModule( GraphBuilderDataSources dataSources, BuildConfig config, Graph graph, - VehicleParkingService parkingService, + VehicleParkingRepository parkingService, DataImportIssueStore issueStore, StreetLimitationParameters streetLimitationParameters ) { @@ -141,7 +141,7 @@ static NetexModule provideNetexModule( BuildConfig config, Graph graph, TimetableRepository timetableRepository, - VehicleParkingService parkingService, + VehicleParkingRepository parkingService, DataImportIssueStore issueStore ) { return new NetexConfigure(config) @@ -159,13 +159,13 @@ static NetexModule provideNetexModule( static StreetLinkerModule provideStreetLinkerModule( BuildConfig config, Graph graph, - VehicleParkingService parkingService, + VehicleParkingRepository parkingRepository, TimetableRepository timetableRepository, DataImportIssueStore issueStore ) { return new StreetLinkerModule( graph, - parkingService, + parkingRepository, timetableRepository, issueStore, config.areaVisibility @@ -177,7 +177,7 @@ static StreetLinkerModule provideStreetLinkerModule( static PruneIslands providePruneIslands( BuildConfig config, Graph graph, - VehicleParkingService parkingService, + VehicleParkingRepository parkingRepository, TimetableRepository timetableRepository, DataImportIssueStore issueStore ) { @@ -187,7 +187,7 @@ static PruneIslands providePruneIslands( issueStore, new StreetLinkerModule( graph, - parkingService, + parkingRepository, timetableRepository, issueStore, config.areaVisibility diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index b026171f557..e3618d6f93d 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -25,7 +25,7 @@ import org.opentripplanner.osm.wayproperty.WayProperties; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.util.ElevationUtils; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -52,7 +52,7 @@ public class OsmModule implements GraphBuilderModule { */ private final List providers; private final Graph graph; - private final VehicleParkingService parkingService; + private final VehicleParkingRepository parkingRepository; private final DataImportIssueStore issueStore; private final OsmProcessingParameters params; private final SafetyValueNormalizer normalizer; @@ -63,7 +63,7 @@ public class OsmModule implements GraphBuilderModule { OsmModule( Collection providers, Graph graph, - VehicleParkingService parkingService, + VehicleParkingRepository parkingService, DataImportIssueStore issueStore, StreetLimitationParameters streetLimitationParameters, OsmProcessingParameters params @@ -76,13 +76,13 @@ public class OsmModule implements GraphBuilderModule { this.vertexGenerator = new VertexGenerator(osmdb, graph, params.boardingAreaRefTags()); this.normalizer = new SafetyValueNormalizer(graph, issueStore); this.streetLimitationParameters = Objects.requireNonNull(streetLimitationParameters); - this.parkingService = parkingService; + this.parkingRepository = parkingService; } public static OsmModuleBuilder of( Collection providers, Graph graph, - VehicleParkingService service + VehicleParkingRepository service ) { return new OsmModuleBuilder(providers, graph, service); } @@ -90,7 +90,7 @@ public static OsmModuleBuilder of( public static OsmModuleBuilder of( OsmProvider provider, Graph graph, - VehicleParkingService service + VehicleParkingRepository service ) { return of(List.of(provider), graph, service); } @@ -175,7 +175,7 @@ private void build() { } if (!parkingLots.isEmpty()) { - parkingService.updateVehicleParking(parkingLots, List.of()); + parkingRepository.updateVehicleParking(parkingLots, List.of()); } var elevatorProcessor = new ElevatorProcessor(issueStore, osmdb, vertexGenerator); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java index 1f66fa65308..2f7f4c506c9 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModuleBuilder.java @@ -8,7 +8,7 @@ import org.opentripplanner.graph_builder.services.osm.EdgeNamer; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.street.model.StreetLimitationParameters; /** @@ -18,7 +18,7 @@ public class OsmModuleBuilder { private final Collection providers; private final Graph graph; - private final VehicleParkingService parkingService; + private final VehicleParkingRepository parkingRepository; private Set boardingAreaRefTags = Set.of(); private DataImportIssueStore issueStore = DataImportIssueStore.NOOP; private EdgeNamer edgeNamer = new DefaultNamer(); @@ -32,11 +32,11 @@ public class OsmModuleBuilder { OsmModuleBuilder( Collection providers, Graph graph, - VehicleParkingService parkingService + VehicleParkingRepository parkingRepository ) { this.providers = providers; this.graph = graph; - this.parkingService = parkingService; + this.parkingRepository = parkingRepository; } public OsmModuleBuilder withBoardingAreaRefTags(Set boardingAreaRefTags) { @@ -88,7 +88,7 @@ public OsmModule build() { return new OsmModule( providers, graph, - parkingService, + parkingRepository, issueStore, streetLimitationParameters, new OsmProcessingParameters( diff --git a/application/src/main/java/org/opentripplanner/netex/NetexModule.java b/application/src/main/java/org/opentripplanner/netex/NetexModule.java index 7d0dcbe0335..e5422c5ac77 100644 --- a/application/src/main/java/org/opentripplanner/netex/NetexModule.java +++ b/application/src/main/java/org/opentripplanner/netex/NetexModule.java @@ -13,7 +13,7 @@ import org.opentripplanner.model.calendar.ServiceDateInterval; import org.opentripplanner.model.impl.OtpTransitServiceBuilder; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; @@ -30,7 +30,7 @@ public class NetexModule implements GraphBuilderModule { private final Graph graph; private final TimetableRepository timetableRepository; - private final VehicleParkingService parkingService; + private final VehicleParkingRepository parkingRepository; private final DataImportIssueStore issueStore; /** @@ -44,7 +44,7 @@ public class NetexModule implements GraphBuilderModule { public NetexModule( Graph graph, TimetableRepository timetableRepository, - VehicleParkingService parkingService, + VehicleParkingRepository parkingRepository, DataImportIssueStore issueStore, int subwayAccessTime, ServiceDateInterval transitPeriodLimit, @@ -52,7 +52,7 @@ public NetexModule( ) { this.graph = graph; this.timetableRepository = timetableRepository; - this.parkingService = parkingService; + this.parkingRepository = parkingRepository; this.issueStore = issueStore; this.subwayAccessTime = subwayAccessTime; this.transitPeriodLimit = transitPeriodLimit; @@ -107,7 +107,7 @@ public void buildGraph() { timetableRepository.validateTimeZones(); var lots = transitBuilder.vehicleParkings(); - parkingService.updateVehicleParking(lots, List.of()); + parkingRepository.updateVehicleParking(lots, List.of()); var linker = new VehicleParkingHelper(graph); lots.forEach(linker::linkVehicleParkingToGraph); } diff --git a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java index 47a51d580f4..5771828395e 100644 --- a/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java +++ b/application/src/main/java/org/opentripplanner/netex/configure/NetexConfigure.java @@ -11,7 +11,7 @@ import org.opentripplanner.netex.config.NetexFeedParameters; import org.opentripplanner.netex.loader.NetexDataSourceHierarchy; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.transit.service.TimetableRepository; @@ -37,7 +37,7 @@ public NetexConfigure(BuildConfig builderParams) { public NetexModule createNetexModule( Iterable> netexSources, TimetableRepository timetableRepository, - VehicleParkingService parkingService, + VehicleParkingRepository parkingRepsitory, Graph graph, DataImportIssueStore issueStore ) { @@ -54,7 +54,7 @@ public NetexModule createNetexModule( return new NetexModule( graph, timetableRepository, - parkingService, + parkingRepsitory, issueStore, buildParams.getSubwayAccessTimeSeconds(), buildParams.getTransitServicePeriod(), diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java new file mode 100644 index 00000000000..f08e26ecb99 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java @@ -0,0 +1,14 @@ +package org.opentripplanner.service.vehicleparking; + +import java.util.Collection; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; + +/** + * The writable data store of parking facilities. + */ +public interface VehicleParkingRepository { + void updateVehicleParking( + Collection parkingToAdd, + Collection parkingToRemove + ); +} diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java index 753d390d2c2..3ca13165a05 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java @@ -1,17 +1,16 @@ package org.opentripplanner.service.vehicleparking; import com.google.common.collect.ImmutableListMultimap; -import java.util.Collection; import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; +/** + * The read-only service for getting information about parking facilities. + *

+ * For writing data see {@link VehicleParkingRepository} + */ public interface VehicleParkingService { - void updateVehicleParking( - Collection parkingToAdd, - Collection parkingToRemove - ); - Stream getBikeParks(); Stream getCarParks(); diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java similarity index 63% rename from application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java index 8b6cb3af7c7..c7224f28dd6 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java @@ -2,11 +2,15 @@ import dagger.Binds; import dagger.Module; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; @Module -public interface VehicleParkingServiceModule { +public interface VehicleParkingModule { @Binds VehicleParkingService bindService(DefaultVehicleParkingService service); + + @Binds + VehicleParkingRepository bindRepository(DefaultVehicleParkingService service); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java index 7c860dd5d94..6f51d84ec66 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -10,6 +10,7 @@ import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -23,7 +24,8 @@ *

THIS CLASS IS THREAD-SAFE

*/ @Singleton -public class DefaultVehicleParkingService implements Serializable, VehicleParkingService { +public class DefaultVehicleParkingService + implements Serializable, VehicleParkingService, VehicleParkingRepository { @Inject public DefaultVehicleParkingService() {} diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 64a63cf84af..c49a5ae9477 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -19,6 +19,7 @@ import org.opentripplanner.routing.algorithm.raptoradapter.transit.mappers.TransitLayerUpdater; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; @@ -95,7 +96,6 @@ public class ConstructApplication { .timetableRepository(timetableRepository) .graphVisualizer(graphVisualizer) .worldEnvelopeRepository(worldEnvelopeRepository) - .vehicleParkingService(vehicleParkingService) .emissionsDataModel(emissionsDataModel) .dataImportIssueSummary(issueSummary) .stopConsolidationRepository(stopConsolidationRepository) @@ -130,7 +130,7 @@ public GraphBuilder createGraphBuilder() { graph(), timetableRepository(), factory.worldEnvelopeRepository(), - factory.vehicleParkingService(), + factory.vehicleParkingRepository(), factory.emissionsDataModel(), factory.stopConsolidationRepository(), factory.streetLimitationParameters(), @@ -167,6 +167,7 @@ private void setupTransitRoutingServer() { graph(), realtimeVehicleRepository(), vehicleRentalRepository(), + vehicleParkingRepository(), vehicleParkingService(), timetableRepository(), routerConfig().updaterConfig() @@ -275,6 +276,10 @@ public VehicleParkingService vehicleParkingService() { return factory.vehicleParkingService(); } + public VehicleParkingRepository vehicleParkingRepository() { + return factory.vehicleParkingRepository(); + } + public Graph graph() { return factory.graph(); } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index 9a484dec5c3..a5166d5ad64 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -22,7 +22,9 @@ import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleRepositoryModule; import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleServiceModule; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.configure.VehicleParkingModule; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.configure.VehicleRentalRepositoryModule; @@ -55,6 +57,7 @@ RealtimeVehicleRepositoryModule.class, VehicleRentalServiceModule.class, VehicleRentalRepositoryModule.class, + VehicleParkingModule.class, ConstructApplicationModule.class, RideHailingServicesModule.class, EmissionsServiceModule.class, @@ -75,8 +78,9 @@ public interface ConstructApplicationFactory { RealtimeVehicleRepository realtimeVehicleRepository(); RealtimeVehicleService realtimeVehicleService(); VehicleRentalRepository vehicleRentalRepository(); - VehicleParkingService vehicleParkingService(); VehicleRentalService vehicleRentalService(); + VehicleParkingRepository vehicleParkingRepository(); + VehicleParkingService vehicleParkingService(); DataImportIssueSummary dataImportIssueSummary(); @Nullable @@ -118,9 +122,6 @@ interface Builder { @BindsInstance Builder worldEnvelopeRepository(WorldEnvelopeRepository worldEnvelopeRepository); - @BindsInstance - Builder vehicleParkingService(VehicleParkingService vehicleParkingService); - @BindsInstance Builder stopConsolidationRepository( @Nullable StopConsolidationRepository stopConsolidationRepository diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java index e269393e039..3ccafc88ec5 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java @@ -12,7 +12,7 @@ import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.vehicleparking.VehicleParkingService; -import org.opentripplanner.service.vehicleparking.configure.VehicleParkingServiceModule; +import org.opentripplanner.service.vehicleparking.configure.VehicleParkingModule; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.configure.WorldEnvelopeRepositoryModule; import org.opentripplanner.standalone.config.CommandLineParameters; @@ -32,7 +32,7 @@ GsDataSourceModule.class, WorldEnvelopeRepositoryModule.class, StopConsolidationRepositoryModule.class, - VehicleParkingServiceModule.class, + VehicleParkingModule.class, } ) public interface LoadApplicationFactory { diff --git a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java index 3be06edd7e2..74ecd9ad4bf 100644 --- a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java +++ b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java @@ -12,6 +12,7 @@ import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.transit.service.TimetableRepository; @@ -50,7 +51,8 @@ public class UpdaterConfigurator { private final UpdatersParameters updatersParameters; private final RealtimeVehicleRepository realtimeVehicleRepository; private final VehicleRentalRepository vehicleRentalRepository; - private final VehicleParkingService vehicleParkingService; + private final VehicleParkingRepository parkingRepository; + private final VehicleParkingService parkingService; private SiriTimetableSnapshotSource siriTimetableSnapshotSource = null; private TimetableSnapshotSource gtfsTimetableSnapshotSource = null; @@ -58,7 +60,8 @@ private UpdaterConfigurator( Graph graph, RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository parkingRepository, + VehicleParkingService parkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -67,14 +70,16 @@ private UpdaterConfigurator( this.vehicleRentalRepository = vehicleRentalRepository; this.timetableRepository = timetableRepository; this.updatersParameters = updatersParameters; - this.vehicleParkingService = vehicleParkingService; + this.parkingRepository = parkingRepository; + this.parkingService = parkingService; } public static void configure( Graph graph, RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository parkingRepository, + VehicleParkingService parkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -82,7 +87,8 @@ public static void configure( graph, realtimeVehicleRepository, vehicleRentalRepository, - vehicleParkingService, + parkingRepository, + parkingService, timetableRepository, updatersParameters ) @@ -201,13 +207,18 @@ private List createUpdatersFromConfig() { openingHoursCalendarService ); updaters.add( - new VehicleParkingUpdater(configItem, source, graph.getLinker(), vehicleParkingService) + new VehicleParkingUpdater(configItem, source, graph.getLinker(), parkingRepository) ); } case AVAILABILITY_ONLY -> { var source = AvailabilityDatasourceFactory.create(configItem); updaters.add( - new VehicleParkingAvailabilityUpdater(configItem, source, vehicleParkingService) + new VehicleParkingAvailabilityUpdater( + configItem, + source, + parkingRepository, + parkingService + ) ); } } diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java index 03c820a58e4..8ad92c5f929 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java @@ -4,6 +4,7 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; @@ -27,18 +28,21 @@ public class VehicleParkingAvailabilityUpdater extends PollingGraphUpdater { VehicleParkingAvailabilityUpdater.class ); private final DataSource source; + private final VehicleParkingService service; private WriteToGraphCallback saveResultOnGraph; - private final VehicleParkingService vehicleParkingService; + private final VehicleParkingRepository repository; public VehicleParkingAvailabilityUpdater( VehicleParkingUpdaterParameters parameters, DataSource source, - VehicleParkingService vehicleParkingService + VehicleParkingRepository parkingRepository, + VehicleParkingService parkingService ) { super(parameters); this.source = source; - this.vehicleParkingService = vehicleParkingService; + this.repository = parkingRepository; + this.service = parkingService; LOG.info("Creating vehicle-parking updater running every {}: {}", pollingPeriod(), source); } @@ -66,7 +70,7 @@ private class AvailabilityUpdater implements GraphWriterRunnable { private AvailabilityUpdater(List updates) { this.updates = List.copyOf(updates); this.parkingById = - vehicleParkingService + service .getVehicleParkings() .collect(Collectors.toUnmodifiableMap(VehicleParking::getId, Function.identity())); } diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java index d4b8e8b7b71..8e4cf8a862b 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java @@ -12,7 +12,7 @@ import org.opentripplanner.routing.linking.DisposableEdgeCollection; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; @@ -45,20 +45,20 @@ public class VehicleParkingUpdater extends PollingGraphUpdater { private WriteToGraphCallback saveResultOnGraph; private final VertexLinker linker; - private final VehicleParkingService vehicleParkingService; + private final VehicleParkingRepository parkingRepository; public VehicleParkingUpdater( VehicleParkingUpdaterParameters parameters, DataSource source, VertexLinker vertexLinker, - VehicleParkingService vehicleParkingService + VehicleParkingRepository parkingRepository ) { super(parameters); this.source = source; // Creation of network linker library will not modify the graph this.linker = vertexLinker; // Adding a vehicle parking station service needs a graph writer runnable - this.vehicleParkingService = vehicleParkingService; + this.parkingRepository = parkingRepository; LOG.info("Creating vehicle-parking updater running every {}: {}", pollingPeriod(), source); } @@ -155,7 +155,7 @@ public void run(RealTimeUpdateContext context) { tempEdgesByPark.put(updatedVehicleParking, disposableEdgeCollectionsForVertex); } - vehicleParkingService.updateVehicleParking(toAdd, toRemove); + parkingRepository.updateVehicleParking(toAdd, toRemove); oldVehicleParkings.removeAll(toRemove); oldVehicleParkings.addAll(toAdd); diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index b9631593f27..3e4f69f54a4 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -11,8 +11,8 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeService; diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index e0930ad8cd5..9070f4f1375 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -71,7 +71,6 @@ import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.vehiclerental.model.TestFreeFloatingRentalVehicleBuilder; @@ -142,7 +141,7 @@ class GraphQLIntegrationTest { private static GraphQLRequestContext context; private static final Deduplicator DEDUPLICATOR = new Deduplicator(); - private static final VehicleParkingService parkingService = new DefaultVehicleParkingService(); + private static final DefaultVehicleParkingService parkingService = new DefaultVehicleParkingService(); @BeforeAll static void setup() { diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index 0ed7edd6653..ee405713f73 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -2,8 +2,8 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.transit.service.TimetableRepository; public class TestStreetLinkerModule { @@ -15,12 +15,12 @@ public static void link(Graph graph, TimetableRepository timetableRepository) { public static void link( Graph graph, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository parkingRepository, TimetableRepository timetableRepository ) { new StreetLinkerModule( graph, - vehicleParkingService, + parkingRepository, timetableRepository, DataImportIssueStore.NOOP, false diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index 9d6fc3ee54b..4f32ab60e76 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -9,8 +9,8 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 49efdb6d47e..dc40bda6654 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -32,8 +32,8 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.impl.GraphPathFinder; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.vertex.BarrierVertex; diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index 39350f01803..f023b14a737 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -23,8 +23,8 @@ import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index 347262449cb..10e456d9eb7 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -100,6 +100,7 @@ public SpeedTest( new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), new DefaultVehicleParkingService(), + new DefaultVehicleParkingService(), timetableRepository, config.updatersConfig ); diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index 451d8c6e77a..e9ce4226318 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -13,7 +13,6 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.standalone.config.routerconfig.updaters.VehicleParkingUpdaterConfig; @@ -51,6 +50,7 @@ void updateCarAvailability() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), + service, service ); @@ -68,6 +68,7 @@ void updateBicycleAvailability() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), + service, service ); @@ -85,6 +86,7 @@ void notFound() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(new AvailabiltyUpdate(id("not-found"), 100)), + service, service ); @@ -95,7 +97,7 @@ void notFound() { assertNull(updated.getAvailability()); } - private static VehicleParkingService buildParkingService(VehicleParkingSpaces capacity) { + private static DefaultVehicleParkingService buildParkingService(VehicleParkingSpaces capacity) { var service = new DefaultVehicleParkingService(); var parking = parkingBuilder() diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index 81aea5ea8db..b035cd02b56 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -11,10 +11,9 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; import org.opentripplanner.service.vehicleparking.VehicleParkingTestUtil; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; @@ -37,7 +36,7 @@ class VehicleParkingUpdaterTest { private DefaultRealTimeUpdateContext realTimeUpdateContext; private VehicleParkingUpdater vehicleParkingUpdater; - private VehicleParkingService vehicleParkingService; + private DefaultVehicleParkingService parkingService; @BeforeEach @SuppressWarnings("unchecked") @@ -46,7 +45,7 @@ public void setup() { graphData.initGraph(); graph = graphData.getGraph(); timetableRepository = graphData.getTimetableRepository(); - vehicleParkingService = new DefaultVehicleParkingService(); + parkingService = new DefaultVehicleParkingService(); realTimeUpdateContext = new DefaultRealTimeUpdateContext(graph, timetableRepository); dataSource = (DataSource) Mockito.mock(DataSource.class); @@ -77,7 +76,7 @@ public String configRef() { } }; vehicleParkingUpdater = - new VehicleParkingUpdater(parameters, dataSource, graph.getLinker(), vehicleParkingService); + new VehicleParkingUpdater(parameters, dataSource, graph.getLinker(), parkingService); } @Test @@ -105,10 +104,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - var vehicleParkingInGraph = vehicleParkingService - .getVehicleParkings() - .findFirst() - .orElseThrow(); + var vehicleParkingInGraph = parkingService.getVehicleParkings().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); @@ -121,7 +117,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - vehicleParkingInGraph = vehicleParkingService.getVehicleParkings().findFirst().orElseThrow(); + vehicleParkingInGraph = parkingService.getVehicleParkings().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); } @@ -156,7 +152,7 @@ void addNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, vehicleParkingService.getVehicleParkings().count()); + assertEquals(1, parkingService.getVehicleParkings().count()); assertVehicleParkingNotLinked(); } @@ -173,10 +169,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, vehicleParkingService.getVehicleParkings().count()); + assertEquals(1, parkingService.getVehicleParkings().count()); assertEquals( vehiclePlaces, - vehicleParkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); @@ -192,10 +188,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, vehicleParkingService.getVehicleParkings().count()); + assertEquals(1, parkingService.getVehicleParkings().count()); assertEquals( vehiclePlaces, - vehicleParkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); } @@ -210,12 +206,12 @@ void deleteNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, vehicleParkingService.getVehicleParkings().count()); + assertEquals(1, parkingService.getVehicleParkings().count()); when(dataSource.getUpdates()).thenReturn(List.of()); runUpdaterOnce(); - assertEquals(0, vehicleParkingService.getVehicleParkings().count()); + assertEquals(0, parkingService.getVehicleParkings().count()); } private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { @@ -256,7 +252,7 @@ private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { ); } - assertEquals(vehicleParkingNumber, vehicleParkingService.getVehicleParkings().count()); + assertEquals(vehicleParkingNumber, parkingService.getVehicleParkings().count()); } private void runUpdaterOnce() { From f063bd992803ab1087a7a95b72e45482e546df6b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 10 Nov 2024 23:33:25 +0100 Subject: [PATCH 09/55] Split into two modules --- .../routing/graph/SerializedGraphObject.java | 8 ++++---- .../configure/VehicleParkingRepositoryModule.java | 13 +++++++++++++ ...Module.java => VehicleParkingServiceModule.java} | 6 +----- .../org/opentripplanner/standalone/OTPMain.java | 2 +- .../standalone/configure/ConstructApplication.java | 3 ++- .../configure/ConstructApplicationFactory.java | 9 +++++++-- .../standalone/configure/LoadApplication.java | 10 +++++----- .../configure/LoadApplicationFactory.java | 8 ++++---- .../routing/graph/GraphSerializationTest.java | 6 +++--- 9 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java rename application/src/main/java/org/opentripplanner/service/vehicleparking/configure/{VehicleParkingModule.java => VehicleParkingServiceModule.java} (63%) diff --git a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java index 60fbb595c5c..a152b96682d 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java @@ -25,7 +25,7 @@ import org.opentripplanner.model.projectinfo.GraphFileHeader; import org.opentripplanner.model.projectinfo.OtpProjectInfo; import org.opentripplanner.routing.graph.kryosupport.KryoBuilder; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.standalone.config.RouterConfig; @@ -80,13 +80,13 @@ public class SerializedGraphObject implements Serializable { private final int routingTripPatternCounter; public final EmissionsDataModel emissionsDataModel; public final StreetLimitationParameters streetLimitationParameters; - public final VehicleParkingService vehicleParkingService; + public final VehicleParkingRepository parkingRepository; public SerializedGraphObject( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository parkingRepository, BuildConfig buildConfig, RouterConfig routerConfig, DataImportIssueSummary issueSummary, @@ -98,7 +98,7 @@ public SerializedGraphObject( this.edges = graph.getEdges(); this.timetableRepository = timetableRepository; this.worldEnvelopeRepository = worldEnvelopeRepository; - this.vehicleParkingService = vehicleParkingService; + this.parkingRepository = parkingRepository; this.buildConfig = buildConfig; this.routerConfig = routerConfig; this.issueSummary = issueSummary; diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java new file mode 100644 index 00000000000..44e353aa3ef --- /dev/null +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java @@ -0,0 +1,13 @@ +package org.opentripplanner.service.vehicleparking.configure; + +import dagger.Binds; +import dagger.Module; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; + +@Module +public interface VehicleParkingRepositoryModule { + @Binds + VehicleParkingRepository bindService(DefaultVehicleParkingService service); + +} diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java similarity index 63% rename from application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java rename to application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java index c7224f28dd6..50b48ef51e0 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingModule.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java @@ -2,15 +2,11 @@ import dagger.Binds; import dagger.Module; -import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; @Module -public interface VehicleParkingModule { +public interface VehicleParkingServiceModule { @Binds VehicleParkingService bindService(DefaultVehicleParkingService service); - - @Binds - VehicleParkingRepository bindRepository(DefaultVehicleParkingService service); } diff --git a/application/src/main/java/org/opentripplanner/standalone/OTPMain.java b/application/src/main/java/org/opentripplanner/standalone/OTPMain.java index fd283abd8cd..e21807f8b7a 100644 --- a/application/src/main/java/org/opentripplanner/standalone/OTPMain.java +++ b/application/src/main/java/org/opentripplanner/standalone/OTPMain.java @@ -152,7 +152,7 @@ private static void startOTPServer(CommandLineParameters cli) { app.graph(), app.timetableRepository(), app.worldEnvelopeRepository(), - app.vehicleParkingService(), + app.vehicleParkingRepository(), config.buildConfig(), config.routerConfig(), DataImportIssueSummary.combine(graphBuilder.issueSummary(), app.dataImportIssueSummary()), diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index c49a5ae9477..91b3173a018 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -77,7 +77,7 @@ public class ConstructApplication { GraphBuilderDataSources graphBuilderDataSources, DataImportIssueSummary issueSummary, EmissionsDataModel emissionsDataModel, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository vehicleParkingRepository, @Nullable StopConsolidationRepository stopConsolidationRepository, StreetLimitationParameters streetLimitationParameters ) { @@ -96,6 +96,7 @@ public class ConstructApplication { .timetableRepository(timetableRepository) .graphVisualizer(graphVisualizer) .worldEnvelopeRepository(worldEnvelopeRepository) + .vehicleParkingRepository(vehicleParkingRepository) .emissionsDataModel(emissionsDataModel) .dataImportIssueSummary(issueSummary) .stopConsolidationRepository(stopConsolidationRepository) diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index a5166d5ad64..bc8be6957da 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -24,7 +24,7 @@ import org.opentripplanner.service.realtimevehicles.configure.RealtimeVehicleServiceModule; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; -import org.opentripplanner.service.vehicleparking.configure.VehicleParkingModule; +import org.opentripplanner.service.vehicleparking.configure.VehicleParkingServiceModule; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.configure.VehicleRentalRepositoryModule; @@ -57,7 +57,7 @@ RealtimeVehicleRepositoryModule.class, VehicleRentalServiceModule.class, VehicleRentalRepositoryModule.class, - VehicleParkingModule.class, + VehicleParkingServiceModule.class, ConstructApplicationModule.class, RideHailingServicesModule.class, EmissionsServiceModule.class, @@ -127,6 +127,11 @@ Builder stopConsolidationRepository( @Nullable StopConsolidationRepository stopConsolidationRepository ); + @BindsInstance + Builder vehicleParkingRepository( + VehicleParkingRepository parkingRepository + ); + @BindsInstance Builder dataImportIssueSummary(DataImportIssueSummary issueSummary); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java index 8fc7176a134..021af778345 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java @@ -8,7 +8,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.standalone.config.CommandLineParameters; import org.opentripplanner.standalone.config.ConfigModel; @@ -57,7 +57,7 @@ public ConstructApplication appConstruction(SerializedGraphObject obj) { obj.graph, obj.timetableRepository, obj.worldEnvelopeRepository, - obj.vehicleParkingService, + obj.parkingRepository, obj.issueSummary, obj.emissionsDataModel, obj.stopConsolidationRepository, @@ -71,7 +71,7 @@ public ConstructApplication appConstruction() { factory.emptyGraph(), factory.emptyTimetableRepository(), factory.emptyWorldEnvelopeRepository(), - factory.emptyVehicleParkingService(), + factory.emptyVehicleParkingRepository(), DataImportIssueSummary.empty(), factory.emptyEmissionsDataModel(), factory.emptyStopConsolidationRepository(), @@ -94,7 +94,7 @@ private ConstructApplication createAppConstruction( Graph graph, TimetableRepository timetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository parkingRepository, DataImportIssueSummary issueSummary, @Nullable EmissionsDataModel emissionsDataModel, @Nullable StopConsolidationRepository stopConsolidationRepository, @@ -109,7 +109,7 @@ private ConstructApplication createAppConstruction( graphBuilderDataSources(), issueSummary, emissionsDataModel, - vehicleParkingService, + parkingRepository, stopConsolidationRepository, streetLimitationParameters ); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java index 3ccafc88ec5..b054fac3ca5 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/LoadApplicationFactory.java @@ -11,8 +11,8 @@ import org.opentripplanner.ext.stopconsolidation.configure.StopConsolidationRepositoryModule; import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; -import org.opentripplanner.service.vehicleparking.configure.VehicleParkingModule; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.configure.VehicleParkingRepositoryModule; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.configure.WorldEnvelopeRepositoryModule; import org.opentripplanner.standalone.config.CommandLineParameters; @@ -32,7 +32,7 @@ GsDataSourceModule.class, WorldEnvelopeRepositoryModule.class, StopConsolidationRepositoryModule.class, - VehicleParkingModule.class, + VehicleParkingRepositoryModule.class, } ) public interface LoadApplicationFactory { @@ -62,7 +62,7 @@ public interface LoadApplicationFactory { StreetLimitationParameters emptyStreetLimitationParameters(); @Singleton - VehicleParkingService emptyVehicleParkingService(); + VehicleParkingRepository emptyVehicleParkingRepository(); @Component.Builder interface Builder { diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index f023b14a737..c4aba539fd3 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -23,7 +23,7 @@ import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; @@ -193,7 +193,7 @@ private void testRoundTrip( Graph originalGraph, TimetableRepository originalTimetableRepository, WorldEnvelopeRepository worldEnvelopeRepository, - VehicleParkingService vehicleParkingService, + VehicleParkingRepository vehicleParkingRepository, EmissionsDataModel emissionsDataModel ) throws Exception { // Now round-trip the graph through serialization. @@ -204,7 +204,7 @@ private void testRoundTrip( originalGraph, originalTimetableRepository, worldEnvelopeRepository, - vehicleParkingService, + vehicleParkingRepository, BuildConfig.DEFAULT, RouterConfig.DEFAULT, DataImportIssueSummary.empty(), From 984b8ed0d547c9d3cc3ae2eeaa45dc9ea0b0e396 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 09:30:58 +0100 Subject: [PATCH 10/55] Extract separate repository implementation --- .../VehicleParkingRepository.java | 6 ++ .../VehicleParkingRepositoryModule.java | 5 +- .../DefaultVehicleParkingRepository.java | 78 +++++++++++++++++++ .../DefaultVehicleParkingService.java | 71 +++-------------- .../ConstructApplicationFactory.java | 4 +- .../configure/UpdaterConfigurator.java | 7 +- .../VehicleParkingAvailabilityUpdater.java | 8 +- ...VehicleParkingAvailabilityUpdaterTest.java | 14 ++-- .../VehicleParkingUpdaterTest.java | 29 +++---- 9 files changed, 122 insertions(+), 100 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java index f08e26ecb99..cdb6f195f10 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java @@ -1,7 +1,10 @@ package org.opentripplanner.service.vehicleparking; +import com.google.common.collect.ImmutableListMultimap; import java.util.Collection; +import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; /** * The writable data store of parking facilities. @@ -11,4 +14,7 @@ void updateVehicleParking( Collection parkingToAdd, Collection parkingToRemove ); + Stream getVehicleParkings(); + + ImmutableListMultimap getVehicleParkingGroups(); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java index 44e353aa3ef..1a4086e325a 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java @@ -3,11 +3,10 @@ import dagger.Binds; import dagger.Module; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; @Module public interface VehicleParkingRepositoryModule { @Binds - VehicleParkingRepository bindService(DefaultVehicleParkingService service); - + VehicleParkingRepository bindService(DefaultVehicleParkingRepository repo); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java new file mode 100644 index 00000000000..b26d8a2dac2 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java @@ -0,0 +1,78 @@ +package org.opentripplanner.service.vehicleparking.internal; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.Multimap; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Stream; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.model.VehicleParking; +import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; + +@Singleton +public class DefaultVehicleParkingRepository implements VehicleParkingRepository { + + @Inject + public DefaultVehicleParkingRepository() {} + + /** + * To ensure that his is thread-safe, the set stored here should always be immutable. + *

+ * The volatile keyword is used to ensure safe publication by clearing CPU caches. + */ + private volatile Set vehicleParkings = Set.of(); + + /** + * To ensure that his is thread-safe, {@link ImmutableListMultimap} is used. + *

+ * The volatile keyword is used to ensure safe publication by clearing CPU caches. + */ + private volatile ImmutableListMultimap vehicleParkingGroups = ImmutableListMultimap.of(); + + /** + * Does atomic update of {@link VehicleParking} and index of {@link VehicleParkingGroup} in this + * service by replacing the existing with a new copy that includes old ones that were not removed + * in the update and the new ones that were added in the update. + */ + @Override + public void updateVehicleParking( + Collection parkingToAdd, + Collection parkingToRemove + ) { + Multimap updatedVehicleParkingGroups = ArrayListMultimap.create( + vehicleParkingGroups + ); + parkingToRemove.forEach(vehicleParking -> { + var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); + if (vehicleParkingGroup != null) { + updatedVehicleParkingGroups.remove(vehicleParking.getVehicleParkingGroup(), vehicleParking); + } + }); + parkingToAdd.forEach(vehicleParking -> { + var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); + if (vehicleParkingGroup != null) { + updatedVehicleParkingGroups.put(vehicleParking.getVehicleParkingGroup(), vehicleParking); + } + }); + vehicleParkingGroups = ImmutableListMultimap.copyOf(updatedVehicleParkingGroups); + + Set updatedVehicleParkings = new HashSet<>(vehicleParkings); + updatedVehicleParkings.removeAll(parkingToRemove); + updatedVehicleParkings.addAll(parkingToAdd); + vehicleParkings = Set.copyOf(updatedVehicleParkings); + } + + @Override + public Stream getVehicleParkings() { + return Stream.empty(); + } + + @Override + public ImmutableListMultimap getVehicleParkingGroups() { + return null; + } +} diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java index 6f51d84ec66..04ff1558347 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -1,14 +1,9 @@ package org.opentripplanner.service.vehicleparking.internal; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; -import com.google.common.collect.Multimap; import jakarta.inject.Inject; import jakarta.inject.Singleton; import java.io.Serializable; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; @@ -24,86 +19,42 @@ *

THIS CLASS IS THREAD-SAFE

*/ @Singleton -public class DefaultVehicleParkingService - implements Serializable, VehicleParkingService, VehicleParkingRepository { +public class DefaultVehicleParkingService implements Serializable, VehicleParkingService { - @Inject - public DefaultVehicleParkingService() {} - - /** - * To ensure that his is thread-safe, the set stored here should always be immutable. - *

- * The volatile keyword is used to ensure safe publication by clearing CPU caches. - */ - private volatile Set vehicleParkings = Set.of(); - - /** - * To ensure that his is thread-safe, {@link ImmutableListMultimap} is used. - *

- * The volatile keyword is used to ensure safe publication by clearing CPU caches. - */ - private volatile ImmutableListMultimap vehicleParkingGroups = ImmutableListMultimap.of(); + private final VehicleParkingRepository repository; - /** - * Does atomic update of {@link VehicleParking} and index of {@link VehicleParkingGroup} in this - * service by replacing the existing with a new copy that includes old ones that were not removed - * in the update and the new ones that were added in the update. - */ - @Override - public void updateVehicleParking( - Collection parkingToAdd, - Collection parkingToRemove - ) { - Multimap updatedVehicleParkingGroups = ArrayListMultimap.create( - vehicleParkingGroups - ); - parkingToRemove.forEach(vehicleParking -> { - var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); - if (vehicleParkingGroup != null) { - updatedVehicleParkingGroups.remove(vehicleParking.getVehicleParkingGroup(), vehicleParking); - } - }); - parkingToAdd.forEach(vehicleParking -> { - var vehicleParkingGroup = vehicleParking.getVehicleParkingGroup(); - if (vehicleParkingGroup != null) { - updatedVehicleParkingGroups.put(vehicleParking.getVehicleParkingGroup(), vehicleParking); - } - }); - vehicleParkingGroups = ImmutableListMultimap.copyOf(updatedVehicleParkingGroups); - - Set updatedVehicleParkings = new HashSet<>(vehicleParkings); - updatedVehicleParkings.removeAll(parkingToRemove); - updatedVehicleParkings.addAll(parkingToAdd); - vehicleParkings = Set.copyOf(updatedVehicleParkings); + @Inject + public DefaultVehicleParkingService(VehicleParkingRepository repository) { + this.repository = repository; } @Override public Stream getBikeParks() { - return vehicleParkings.stream().filter(VehicleParking::hasBicyclePlaces); + return repository.getVehicleParkings().filter(VehicleParking::hasBicyclePlaces); } @Override public Stream getCarParks() { - return vehicleParkings.stream().filter(VehicleParking::hasAnyCarPlaces); + return repository.getVehicleParkings().filter(VehicleParking::hasAnyCarPlaces); } @Override public Stream getVehicleParkings() { - return vehicleParkings.stream(); + return repository.getVehicleParkings(); } @Override public ImmutableListMultimap getVehicleParkingGroups() { - return vehicleParkingGroups; + return repository.getVehicleParkingGroups(); } @Override public boolean hasBikeParking() { - return vehicleParkings.stream().anyMatch(VehicleParking::hasBicyclePlaces); + return repository.getVehicleParkings().anyMatch(VehicleParking::hasBicyclePlaces); } @Override public boolean hasCarParking() { - return vehicleParkings.stream().anyMatch(VehicleParking::hasAnyCarPlaces); + return repository.getVehicleParkings().anyMatch(VehicleParking::hasAnyCarPlaces); } } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index bc8be6957da..d6310c0c616 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -128,9 +128,7 @@ Builder stopConsolidationRepository( ); @BindsInstance - Builder vehicleParkingRepository( - VehicleParkingRepository parkingRepository - ); + Builder vehicleParkingRepository(VehicleParkingRepository parkingRepository); @BindsInstance Builder dataImportIssueSummary(DataImportIssueSummary issueSummary); diff --git a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java index 74ecd9ad4bf..7cb0c2fdc29 100644 --- a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java +++ b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java @@ -213,12 +213,7 @@ private List createUpdatersFromConfig() { case AVAILABILITY_ONLY -> { var source = AvailabilityDatasourceFactory.create(configItem); updaters.add( - new VehicleParkingAvailabilityUpdater( - configItem, - source, - parkingRepository, - parkingService - ) + new VehicleParkingAvailabilityUpdater(configItem, source, parkingRepository) ); } } diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java index 8ad92c5f929..c4de4de23a1 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java @@ -5,7 +5,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -28,7 +27,6 @@ public class VehicleParkingAvailabilityUpdater extends PollingGraphUpdater { VehicleParkingAvailabilityUpdater.class ); private final DataSource source; - private final VehicleParkingService service; private WriteToGraphCallback saveResultOnGraph; private final VehicleParkingRepository repository; @@ -36,13 +34,11 @@ public class VehicleParkingAvailabilityUpdater extends PollingGraphUpdater { public VehicleParkingAvailabilityUpdater( VehicleParkingUpdaterParameters parameters, DataSource source, - VehicleParkingRepository parkingRepository, - VehicleParkingService parkingService + VehicleParkingRepository parkingRepository ) { super(parameters); this.source = source; this.repository = parkingRepository; - this.service = parkingService; LOG.info("Creating vehicle-parking updater running every {}: {}", pollingPeriod(), source); } @@ -70,7 +66,7 @@ private class AvailabilityUpdater implements GraphWriterRunnable { private AvailabilityUpdater(List updates) { this.updates = List.copyOf(updates); this.parkingById = - service + repository .getVehicleParkings() .collect(Collectors.toUnmodifiableMap(VehicleParking::getId, Function.identity())); } diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index e9ce4226318..e6e436de975 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -12,7 +12,8 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.standalone.config.routerconfig.updaters.VehicleParkingUpdaterConfig; @@ -50,7 +51,6 @@ void updateCarAvailability() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), - service, service ); @@ -68,7 +68,6 @@ void updateBicycleAvailability() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), - service, service ); @@ -86,7 +85,6 @@ void notFound() { var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(new AvailabiltyUpdate(id("not-found"), 100)), - service, service ); @@ -97,16 +95,16 @@ void notFound() { assertNull(updated.getAvailability()); } - private static DefaultVehicleParkingService buildParkingService(VehicleParkingSpaces capacity) { - var service = new DefaultVehicleParkingService(); + private static VehicleParkingRepository buildParkingService(VehicleParkingSpaces capacity) { + var repo = new DefaultVehicleParkingRepository(); var parking = parkingBuilder() .carPlaces(capacity.getCarSpaces() != null) .bicyclePlaces(capacity.getBicycleSpaces() != null) .capacity(capacity) .build(); - service.updateVehicleParking(List.of(parking), List.of()); - return service; + repo.updateVehicleParking(List.of(parking), List.of()); + return repo; } private static VehicleParking.VehicleParkingBuilder parkingBuilder() { diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index b035cd02b56..dbabc3dd89c 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -11,9 +11,10 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.opentripplanner.routing.graph.Graph; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; import org.opentripplanner.service.vehicleparking.VehicleParkingTestUtil; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; import org.opentripplanner.service.vehicleparking.model.VehicleParkingState; @@ -36,7 +37,7 @@ class VehicleParkingUpdaterTest { private DefaultRealTimeUpdateContext realTimeUpdateContext; private VehicleParkingUpdater vehicleParkingUpdater; - private DefaultVehicleParkingService parkingService; + private VehicleParkingRepository parkingRepository; @BeforeEach @SuppressWarnings("unchecked") @@ -45,7 +46,7 @@ public void setup() { graphData.initGraph(); graph = graphData.getGraph(); timetableRepository = graphData.getTimetableRepository(); - parkingService = new DefaultVehicleParkingService(); + parkingRepository = new DefaultVehicleParkingRepository(); realTimeUpdateContext = new DefaultRealTimeUpdateContext(graph, timetableRepository); dataSource = (DataSource) Mockito.mock(DataSource.class); @@ -76,7 +77,7 @@ public String configRef() { } }; vehicleParkingUpdater = - new VehicleParkingUpdater(parameters, dataSource, graph.getLinker(), parkingService); + new VehicleParkingUpdater(parameters, dataSource, graph.getLinker(), parkingRepository); } @Test @@ -104,7 +105,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - var vehicleParkingInGraph = parkingService.getVehicleParkings().findFirst().orElseThrow(); + var vehicleParkingInGraph = parkingRepository.getVehicleParkings().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); @@ -117,7 +118,7 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - vehicleParkingInGraph = parkingService.getVehicleParkings().findFirst().orElseThrow(); + vehicleParkingInGraph = parkingRepository.getVehicleParkings().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); } @@ -152,7 +153,7 @@ void addNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingService.getVehicleParkings().count()); + assertEquals(1, parkingRepository.getVehicleParkings().count()); assertVehicleParkingNotLinked(); } @@ -169,10 +170,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingService.getVehicleParkings().count()); + assertEquals(1, parkingRepository.getVehicleParkings().count()); assertEquals( vehiclePlaces, - parkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingRepository.getVehicleParkings().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); @@ -188,10 +189,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingService.getVehicleParkings().count()); + assertEquals(1, parkingRepository.getVehicleParkings().count()); assertEquals( vehiclePlaces, - parkingService.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingRepository.getVehicleParkings().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); } @@ -206,12 +207,12 @@ void deleteNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingService.getVehicleParkings().count()); + assertEquals(1, parkingRepository.getVehicleParkings().count()); when(dataSource.getUpdates()).thenReturn(List.of()); runUpdaterOnce(); - assertEquals(0, parkingService.getVehicleParkings().count()); + assertEquals(0, parkingRepository.getVehicleParkings().count()); } private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { @@ -252,7 +253,7 @@ private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { ); } - assertEquals(vehicleParkingNumber, parkingService.getVehicleParkings().count()); + assertEquals(vehicleParkingNumber, parkingRepository.getVehicleParkings().count()); } private void runUpdaterOnce() { From be47aaf74bbba25e99a848a8d7c0ecd573e8ad97 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 09:38:54 +0100 Subject: [PATCH 11/55] Properly implement repository --- .../internal/DefaultVehicleParkingRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java index b26d8a2dac2..660b539052e 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java @@ -68,11 +68,11 @@ public void updateVehicleParking( @Override public Stream getVehicleParkings() { - return Stream.empty(); + return vehicleParkings.stream(); } @Override public ImmutableListMultimap getVehicleParkingGroups() { - return null; + return vehicleParkingGroups; } } From 3b3b135963db5df85b501268f5ca320e21d52cff Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 12:59:35 +0100 Subject: [PATCH 12/55] Update tests --- .../vehicleparkings/VehicleParkingGroupsLayerTest.java | 7 ++++--- .../layers/vehicleparkings/VehicleParkingsLayerTest.java | 7 ++++--- .../test/java/org/opentripplanner/ConstantsForTests.java | 8 ++++---- .../opentripplanner/apis/gtfs/GraphQLIntegrationTest.java | 8 +++++--- .../VehicleParkingAvailabilityUpdaterTest.java | 8 ++++---- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java index 06a6d7088a1..b8a88c11703 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerTest.java @@ -20,6 +20,7 @@ import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.inspector.vector.LayerParameters; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -90,8 +91,8 @@ public void setUp() { @Test public void vehicleParkingGroupGeometryTest() { - var service = new DefaultVehicleParkingService(); - service.updateVehicleParking(List.of(vehicleParking), List.of()); + var repository = new DefaultVehicleParkingRepository(); + repository.updateVehicleParking(List.of(vehicleParking), List.of()); var config = """ @@ -115,7 +116,7 @@ public void vehicleParkingGroupGeometryTest() { var tiles = VectorTileConfig.mapVectorTilesParameters(nodeAdapter, "vectorTiles"); assertEquals(1, tiles.layers().size()); var builder = new VehicleParkingGroupsLayerBuilderWithPublicGeometry( - service, + new DefaultVehicleParkingService(repository), tiles.layers().get(0), Locale.US ); diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java index 4e4b5e507af..ae4386e9dd6 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerTest.java @@ -23,6 +23,7 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.TranslatedString; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces; @@ -85,8 +86,8 @@ public void setUp() { @Test public void vehicleParkingGeometryTest() { - var service = new DefaultVehicleParkingService(); - service.updateVehicleParking(List.of(vehicleParking), List.of()); + var repo = new DefaultVehicleParkingRepository(); + repo.updateVehicleParking(List.of(vehicleParking), List.of()); var config = """ @@ -109,7 +110,7 @@ public void vehicleParkingGeometryTest() { var nodeAdapter = newNodeAdapterForTest(config); var tiles = VectorTileConfig.mapVectorTilesParameters(nodeAdapter, "vectorTiles"); assertEquals(1, tiles.layers().size()); - var builder = new VehicleParkingsLayerBuilder(service, tiles.layers().getFirst(), Locale.US); + var builder = new VehicleParkingsLayerBuilder(new DefaultVehicleParkingService(repo), tiles.layers().getFirst(), Locale.US); List geometries = builder.getGeometries(new Envelope(0.99, 1.01, 1.99, 2.01)); diff --git a/application/src/test/java/org/opentripplanner/ConstantsForTests.java b/application/src/test/java/org/opentripplanner/ConstantsForTests.java index 8f8eacd3d88..cedd295bbfc 100644 --- a/application/src/test/java/org/opentripplanner/ConstantsForTests.java +++ b/application/src/test/java/org/opentripplanner/ConstantsForTests.java @@ -31,7 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink; @@ -136,7 +136,7 @@ public static TestOtpModel buildNewPortlandGraph(boolean withElevation) { { OsmProvider osmProvider = new OsmProvider(PORTLAND_CENTRAL_OSM, false); OsmModule osmModule = OsmModule - .of(osmProvider, graph, new DefaultVehicleParkingService()) + .of(osmProvider, graph, new DefaultVehicleParkingRepository()) .withStaticParkAndRide(true) .withStaticBikeParkAndRide(true) .build(); @@ -186,7 +186,7 @@ public static TestOtpModel buildOsmGraph(File osmFile) { // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); OsmModule osmModule = OsmModule - .of(osmProvider, graph, new DefaultVehicleParkingService()) + .of(osmProvider, graph, new DefaultVehicleParkingRepository()) .build(); osmModule.buildGraph(); return new TestOtpModel(graph, timetableRepository); @@ -229,7 +229,7 @@ public static TestOtpModel buildNewMinimalNetexGraph() { try { var deduplicator = new Deduplicator(); var siteRepository = new SiteRepository(); - var parkingService = new DefaultVehicleParkingService(); + var parkingService = new DefaultVehicleParkingRepository(); var graph = new Graph(deduplicator); var timetableRepository = new TimetableRepository(siteRepository, deduplicator); // Add street data from OSM diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 9070f4f1375..e14bded2478 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -70,6 +70,8 @@ import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; @@ -141,11 +143,11 @@ class GraphQLIntegrationTest { private static GraphQLRequestContext context; private static final Deduplicator DEDUPLICATOR = new Deduplicator(); - private static final DefaultVehicleParkingService parkingService = new DefaultVehicleParkingService(); + private static final VehicleParkingRepository parkingRepository = new DefaultVehicleParkingRepository(); @BeforeAll static void setup() { - parkingService.updateVehicleParking( + parkingRepository.updateVehicleParking( List.of( VehicleParking .builder() @@ -316,7 +318,7 @@ public Set getRoutesForStop(StopLocation stop) { transitService, new DefaultFareService(), defaultVehicleRentalService, - parkingService, + new DefaultVehicleParkingService(parkingRepository), realtimeVehicleService, finder, new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index e6e436de975..26e8403abe9 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -47,7 +47,7 @@ class VehicleParkingAvailabilityUpdaterTest { @Test void updateCarAvailability() { - var service = buildParkingService(VehicleParkingSpaces.builder().carSpaces(10).build()); + var service = buildParkingRepository(VehicleParkingSpaces.builder().carSpaces(10).build()); var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), @@ -64,7 +64,7 @@ void updateCarAvailability() { @Test void updateBicycleAvailability() { - var service = buildParkingService(VehicleParkingSpaces.builder().bicycleSpaces(15).build()); + var service = buildParkingRepository(VehicleParkingSpaces.builder().bicycleSpaces(15).build()); var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(DEFAULT_UPDATE), @@ -81,7 +81,7 @@ void updateBicycleAvailability() { @Test void notFound() { - var service = buildParkingService(VehicleParkingSpaces.builder().bicycleSpaces(15).build()); + var service = buildParkingRepository(VehicleParkingSpaces.builder().bicycleSpaces(15).build()); var updater = new VehicleParkingAvailabilityUpdater( PARAMETERS, new StubDatasource(new AvailabiltyUpdate(id("not-found"), 100)), @@ -95,7 +95,7 @@ void notFound() { assertNull(updated.getAvailability()); } - private static VehicleParkingRepository buildParkingService(VehicleParkingSpaces capacity) { + private static VehicleParkingRepository buildParkingRepository(VehicleParkingSpaces capacity) { var repo = new DefaultVehicleParkingRepository(); var parking = parkingBuilder() From 2e3259620b4731e117ebce758296db5d22870b2f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 13:19:24 +0100 Subject: [PATCH 13/55] Update tests --- .../configure/ConstructApplication.java | 1 - .../updater/configure/UpdaterConfigurator.java | 6 ------ .../org/opentripplanner/TestServerContext.java | 3 ++- .../LegacyRouteRequestMapperTest.java | 3 ++- .../routerequest/RouteRequestMapperTest.java | 3 ++- .../mapping/TripRequestMapperTest.java | 3 ++- .../module/OsmBoardingLocationsModuleTest.java | 4 ++-- .../module/StreetLinkerModuleTest.java | 4 ++-- .../module/TestStreetLinkerModule.java | 4 ++-- .../module/VehicleParkingLinkingTest.java | 4 ++-- .../islandpruning/IslandPruningUtils.java | 4 ++-- .../module/linking/LinkingTest.java | 4 ++-- .../graph_builder/module/osm/OsmModuleTest.java | 17 +++++++++-------- .../module/osm/PlatformLinkerTest.java | 4 ++-- .../module/osm/TriangleInequalityTest.java | 4 ++-- .../module/osm/UnconnectedAreasTest.java | 4 ++-- .../module/osm/UnroutableTest.java | 4 ++-- .../routing/graph/GraphSerializationTest.java | 10 +++++----- .../transit/speed_test/SpeedTest.java | 5 ++--- 19 files changed, 44 insertions(+), 47 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 91b3173a018..eb3fae5275f 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -169,7 +169,6 @@ private void setupTransitRoutingServer() { realtimeVehicleRepository(), vehicleRentalRepository(), vehicleParkingRepository(), - vehicleParkingService(), timetableRepository(), routerConfig().updaterConfig() ); diff --git a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java index 7cb0c2fdc29..1106d621873 100644 --- a/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java +++ b/application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java @@ -13,7 +13,6 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalRepository; import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.updater.DefaultRealTimeUpdateContext; @@ -52,7 +51,6 @@ public class UpdaterConfigurator { private final RealtimeVehicleRepository realtimeVehicleRepository; private final VehicleRentalRepository vehicleRentalRepository; private final VehicleParkingRepository parkingRepository; - private final VehicleParkingService parkingService; private SiriTimetableSnapshotSource siriTimetableSnapshotSource = null; private TimetableSnapshotSource gtfsTimetableSnapshotSource = null; @@ -61,7 +59,6 @@ private UpdaterConfigurator( RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, VehicleParkingRepository parkingRepository, - VehicleParkingService parkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -71,7 +68,6 @@ private UpdaterConfigurator( this.timetableRepository = timetableRepository; this.updatersParameters = updatersParameters; this.parkingRepository = parkingRepository; - this.parkingService = parkingService; } public static void configure( @@ -79,7 +75,6 @@ public static void configure( RealtimeVehicleRepository realtimeVehicleRepository, VehicleRentalRepository vehicleRentalRepository, VehicleParkingRepository parkingRepository, - VehicleParkingService parkingService, TimetableRepository timetableRepository, UpdatersParameters updatersParameters ) { @@ -88,7 +83,6 @@ public static void configure( realtimeVehicleRepository, vehicleRentalRepository, parkingRepository, - parkingService, timetableRepository, updatersParameters ) diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index 3e4f69f54a4..e20720bd7d8 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -12,6 +12,7 @@ import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; @@ -91,7 +92,7 @@ public static VehicleRentalService createVehicleRentalService() { } public static VehicleParkingService createVehicleParkingService() { - return new DefaultVehicleParkingService(); + return new DefaultVehicleParkingService(new DefaultVehicleParkingRepository()); } public static EmissionsService createEmissionsService() { diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java index bf80f5f2185..43dd10dbdce 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java @@ -35,6 +35,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.street.search.TraverseMode; @@ -62,7 +63,7 @@ class LegacyRouteRequestMapperTest implements PlanTestConstants { transitService, new DefaultFareService(), new DefaultVehicleRentalService(), - new DefaultVehicleParkingService(), + new DefaultVehicleParkingService(new DefaultVehicleParkingRepository()), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java index 618ad89f046..34cb865c81a 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperTest.java @@ -31,6 +31,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graphfinder.GraphFinder; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -72,7 +73,7 @@ class RouteRequestMapperTest { transitService, new DefaultFareService(), new DefaultVehicleRentalService(), - new DefaultVehicleParkingService(), + new DefaultVehicleParkingService(new DefaultVehicleParkingRepository()), new DefaultRealtimeVehicleService(transitService), GraphFinder.getInstance(graph, transitService::findRegularStops), new RouteRequest() diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 67dbe5c18d9..b3c64e0aecb 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -47,6 +47,7 @@ import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; @@ -145,7 +146,7 @@ void setup() { new DefaultWorldEnvelopeService(new DefaultWorldEnvelopeRepository()), new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), - new DefaultVehicleParkingService(), + new DefaultVehicleParkingService(new DefaultVehicleParkingRepository()), new DefaultEmissionsService(new EmissionsDataModel()), null, RouterConfig.DEFAULT.flexParameters(), diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java index c7295640a18..c55e482e533 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java @@ -14,7 +14,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.edge.BoardingLocationToStopLink; import org.opentripplanner.street.model.edge.Edge; @@ -84,7 +84,7 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVerti new NonLocalizedString("bus stop not connected to street network") ); var osmModule = OsmModule - .of(provider, graph, new DefaultVehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingRepository()) .withBoardingAreaRefTags(Set.of("ref", "ref:IFOPT")) .withAreaVisibility(areaVisibility) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 425fa186312..4f54581fdb8 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -18,7 +18,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetTransitStopLink; @@ -174,7 +174,7 @@ public TestModel() { module = new StreetLinkerModule( graph, - new DefaultVehicleParkingService(), + new DefaultVehicleParkingRepository(), timetableRepository, DataImportIssueStore.NOOP, false diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java index ee405713f73..551564cbb05 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/TestStreetLinkerModule.java @@ -3,14 +3,14 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.transit.service.TimetableRepository; public class TestStreetLinkerModule { /** For test only */ public static void link(Graph graph, TimetableRepository timetableRepository) { - link(graph, new DefaultVehicleParkingService(), timetableRepository); + link(graph, new DefaultVehicleParkingRepository(), timetableRepository); } public static void link( diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index 4f32ab60e76..02795b45042 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -10,7 +10,7 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.vehicleparking.VehicleParkingTestGraphData; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParkingHelper; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; @@ -170,7 +170,7 @@ public void removeVehicleParkingWithOneEntranceAndNonExistingVertexTest() { ) .build(); - var vehicleParkingService = new DefaultVehicleParkingService(); + var vehicleParkingService = new DefaultVehicleParkingRepository(); vehicleParkingService.updateVehicleParking(List.of(vehicleParking), List.of()); helper.linkVehicleParkingToGraph(vehicleParking); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java index e6ce7410ae6..d71a60a972e 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/IslandPruningUtils.java @@ -5,7 +5,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.service.SiteRepository; import org.opentripplanner.transit.service.TimetableRepository; @@ -26,7 +26,7 @@ static Graph buildOsmGraph( // Add street data from OSM OsmProvider osmProvider = new OsmProvider(osmFile, true); OsmModule osmModule = OsmModule - .of(osmProvider, graph, new DefaultVehicleParkingService()) + .of(osmProvider, graph, new DefaultVehicleParkingRepository()) .withEdgeNamer(new TestNamer()) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java index 9f124e25ac9..a6afa89707f 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/linking/LinkingTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.StreetEdge; @@ -158,7 +158,7 @@ public static TestOtpModel buildGraphNoTransit() { File file = ResourceLoader.of(LinkingTest.class).file("columbus.osm.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule osmModule = OsmModule.of(provider, gg, new DefaultVehicleParkingService()).build(); + OsmModule osmModule = OsmModule.of(provider, gg, new DefaultVehicleParkingRepository()).build(); osmModule.buildGraph(); return new TestOtpModel(gg, timetableRepository); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index dc40bda6654..3c391a57246 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -32,7 +32,8 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.impl.GraphPathFinder; -import org.opentripplanner.service.vehicleparking.VehicleParkingService; +import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.StreetEdge; @@ -59,7 +60,7 @@ public void testGraphBuilder() { OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, gg, new DefaultVehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingRepository()) .withAreaVisibility(true) .build(); @@ -118,7 +119,7 @@ public void testBuildGraphDetailed() { File file = RESOURCE_LOADER.file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, gg, new DefaultVehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingRepository()) .withAreaVisibility(true) .build(); @@ -283,7 +284,7 @@ public void testLocalizedString() { @Test void addParkingLotsToService() { - var service = buildParkingLots().service; + var service = new DefaultVehicleParkingService(buildParkingLots().repository); assertEquals(11, service.getVehicleParkings().count()); assertEquals(6, service.getBikeParks().count()); @@ -314,7 +315,7 @@ void testBarrierAtEnd() { File file = RESOURCE_LOADER.file("accessno-at-end.pbf"); OsmProvider provider = new OsmProvider(file, false); - OsmModule loader = OsmModule.of(provider, graph, new DefaultVehicleParkingService()).build(); + OsmModule loader = OsmModule.of(provider, graph, new DefaultVehicleParkingRepository()).build(); loader.buildGraph(); Vertex start = graph.getVertex(VertexLabel.osm(1)); @@ -331,7 +332,7 @@ void testBarrierAtEnd() { private BuildResult buildParkingLots() { var graph = new Graph(); - var service = new DefaultVehicleParkingService(); + var service = new DefaultVehicleParkingRepository(); var providers = Stream .of("B+R.osm.pbf", "P+R.osm.pbf") .map(RESOURCE_LOADER::file) @@ -346,7 +347,7 @@ private BuildResult buildParkingLots() { return new BuildResult(graph, service); } - private record BuildResult(Graph graph, VehicleParkingService service) {} + private record BuildResult(Graph graph, VehicleParkingRepository repository) {} /** * This reads test file with area and tests if it can be routed if visibility is used and if it @@ -365,7 +366,7 @@ private void testBuildingAreas(boolean skipVisibility) { OsmProvider provider = new OsmProvider(file, false); OsmModule loader = OsmModule - .of(provider, graph, new DefaultVehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingRepository()) .withAreaVisibility(!skipVisibility) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java index 5a63e4683b2..f952bf90710 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/PlatformLinkerTest.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.edge.AreaEdge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -31,7 +31,7 @@ public void testLinkEntriesToPlatforms() { OsmProvider provider = new OsmProvider(file, false); OsmModule osmModule = OsmModule - .of(provider, gg, new DefaultVehicleParkingService()) + .of(provider, gg, new DefaultVehicleParkingRepository()) .withPlatformEntriesLinking(true) .build(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java index b81ecc6c6e5..ffc1f661dcc 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/TriangleInequalityTest.java @@ -21,7 +21,7 @@ import org.opentripplanner.routing.api.request.request.filter.AllowAllTransitFilter; import org.opentripplanner.routing.api.request.request.filter.TransitFilter; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -52,7 +52,7 @@ public static void onlyOnce() { File file = ResourceLoader.of(TriangleInequalityTest.class).file("NYC_small.osm.pbf"); OsmProvider provider = new OsmProvider(file, true); OsmModule osmModule = OsmModule - .of(provider, graph, new DefaultVehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingRepository()) .withAreaVisibility(true) .build(); osmModule.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java index 7837f757b92..103dafa61b9 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnconnectedAreasTest.java @@ -13,7 +13,7 @@ import org.opentripplanner.graph_builder.module.TestStreetLinkerModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.edge.StreetVehicleParkingLink; import org.opentripplanner.street.model.edge.VehicleParkingEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; @@ -163,7 +163,7 @@ private Graph buildOsmGraph(String osmFileName, DataImportIssueStore issueStore) var timetableRepository = new TimetableRepository(siteRepository, deduplicator); OsmProvider provider = new OsmProvider(RESOURCE_LOADER.file(osmFileName), false); OsmModule loader = OsmModule - .of(provider, graph, new DefaultVehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingRepository()) .withIssueStore(issueStore) .withAreaVisibility(true) .withStaticParkAndRide(true) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java index 5c898fe446e..138c3e67181 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/UnroutableTest.java @@ -10,7 +10,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.graph.Graph; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.model.vertex.VertexLabel; @@ -39,7 +39,7 @@ public void setUp() throws Exception { var osmDataFile = ResourceLoader.of(UnroutableTest.class).file("bridge_construction.osm.pbf"); OsmProvider provider = new OsmProvider(osmDataFile, true); OsmModule osmBuilder = OsmModule - .of(provider, graph, new DefaultVehicleParkingService()) + .of(provider, graph, new DefaultVehicleParkingRepository()) .withAreaVisibility(true) .build(); osmBuilder.buildGraph(); diff --git a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java index c4aba539fd3..400a9eba2ba 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/GraphSerializationTest.java @@ -24,7 +24,7 @@ import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.internal.DefaultWorldEnvelopeRepository; import org.opentripplanner.standalone.config.BuildConfig; @@ -69,12 +69,12 @@ public void testRoundTripSerializationForGTFSGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewPortlandGraph(true); var weRepo = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); - var parkingService = new DefaultVehicleParkingService(); + var parkingRepository = new DefaultVehicleParkingRepository(); testRoundTrip( model.graph(), model.timetableRepository(), weRepo, - parkingService, + parkingRepository, emissionsDataModel ); } @@ -87,12 +87,12 @@ public void testRoundTripSerializationForNetexGraph() throws Exception { TestOtpModel model = ConstantsForTests.buildNewMinimalNetexGraph(); var worldEnvelopeRepository = new DefaultWorldEnvelopeRepository(); var emissionsDataModel = new EmissionsDataModel(); - var parkingService = new DefaultVehicleParkingService(); + var parkingRepository = new DefaultVehicleParkingRepository(); testRoundTrip( model.graph(), model.timetableRepository(), worldEnvelopeRepository, - parkingService, + parkingRepository, emissionsDataModel ); } diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index 10e456d9eb7..ee8c9bc5ba9 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -23,7 +23,7 @@ import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.SerializedGraphObject; import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; -import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingService; +import org.opentripplanner.service.vehicleparking.internal.DefaultVehicleParkingRepository; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; import org.opentripplanner.standalone.OtpStartupInfo; import org.opentripplanner.standalone.api.OtpServerRequestContext; @@ -99,8 +99,7 @@ public SpeedTest( graph, new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), - new DefaultVehicleParkingService(), - new DefaultVehicleParkingService(), + new DefaultVehicleParkingRepository(), timetableRepository, config.updatersConfig ); From 565bae28b7086129726f5fff9216f52026051ea6 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 13:26:17 +0100 Subject: [PATCH 14/55] Rename methods --- .../configure/VehicleParkingRepositoryModule.java | 2 +- .../vehicleparking/configure/VehicleParkingServiceModule.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java index 1a4086e325a..23c5b3e0e51 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingRepositoryModule.java @@ -8,5 +8,5 @@ @Module public interface VehicleParkingRepositoryModule { @Binds - VehicleParkingRepository bindService(DefaultVehicleParkingRepository repo); + VehicleParkingRepository bind(DefaultVehicleParkingRepository repo); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java index 50b48ef51e0..50dbe4b2bcb 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/configure/VehicleParkingServiceModule.java @@ -8,5 +8,5 @@ @Module public interface VehicleParkingServiceModule { @Binds - VehicleParkingService bindService(DefaultVehicleParkingService service); + VehicleParkingService bind(DefaultVehicleParkingService service); } From e639f2a655f0ad62f490e45d497b643bafbea995 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 11 Nov 2024 13:30:34 +0100 Subject: [PATCH 15/55] Update codegen config --- .../apis/gtfs/generated/graphql-codegen.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml b/application/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml index 2a7f2a95ba0..abc380d41e1 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml @@ -43,7 +43,7 @@ config: AlertCauseType: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertCauseType#GraphQLAlertCauseType AlertEffectType: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertEffectType#GraphQLAlertEffectType AlertSeverityLevelType: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertSeverityLevelType#GraphQLAlertSeverityLevelType - BikePark: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking + BikePark: org.opentripplanner.service.vehicleparking.model.VehicleParking#VehicleParking BikeRentalStation: org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace#VehicleRentalPlace BikeRentalStationUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris VehicleRentalStation: org.opentripplanner.service.vehiclerental.model.VehicleRentalStation#VehicleRentalStation @@ -55,7 +55,7 @@ config: BikesAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed#GraphQLBikesAllowed BookingInfo: org.opentripplanner.transit.model.timetable.booking.BookingInfo#BookingInfo BookingTime: org.opentripplanner.transit.model.timetable.booking.BookingTime#BookingTime - CarPark: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking + CarPark: org.opentripplanner.service.vehicleparking.model.VehicleParking#VehicleParking ContactInfo: org.opentripplanner.transit.model.organization.ContactInfo Cluster: Object Coordinates: org.locationtech.jts.geom.Coordinate#Coordinate @@ -104,9 +104,9 @@ config: Trip: org.opentripplanner.transit.model.timetable.Trip#Trip TripOccupancy: org.opentripplanner.apis.gtfs.model.TripOccupancy#TripOccupancy Unknown: org.opentripplanner.apis.gtfs.model.UnknownModel#UnknownModel - VehicleParking: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking - VehicleParkingSpaces: org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces#VehicleParkingSpaces - VehicleParkingState: org.opentripplanner.routing.vehicle_parking.VehicleParkingState#VehicleParkingState + VehicleParking: org.opentripplanner.service.vehicleparking.model.VehicleParking#VehicleParking + VehicleParkingSpaces: org.opentripplanner.service.vehicleparking.model.VehicleParkingSpaces#VehicleParkingSpaces + VehicleParkingState: org.opentripplanner.service.vehicleparking.model.VehicleParkingState#VehicleParkingState VertexType: String SystemNotice: org.opentripplanner.model.SystemNotice#SystemNotice VehiclePosition: org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle#RealtimeVehicle From 204624b3d30e33d5b05589b087fbc5292fcb9b64 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 13 Nov 2024 13:12:48 +0100 Subject: [PATCH 16/55] Rename all methods in TransitService according to naming conventions --- .../ext/geocoder/LuceneIndexTest.java | 6 +- .../layers/TestTransitService.java | 2 +- .../opentripplanner/ext/flex/FlexRouter.java | 4 +- .../ext/geocoder/StopClusterMapper.java | 6 +- .../reportapi/model/GraphReportBuilder.java | 6 +- .../ext/reportapi/model/TransfersReport.java | 4 +- .../reportapi/resource/ReportResource.java | 2 +- .../ext/restapi/model/ApiRouterInfo.java | 2 +- .../restapi/model/ApiTravelOptionsMaker.java | 2 +- .../ext/restapi/resources/IndexAPI.java | 40 +++---- .../ext/vectortiles/VectorTilesResource.java | 2 +- .../ext/vectortiles/layers/LayerFilters.java | 2 +- .../areastops/AreaStopPropertyMapper.java | 2 +- .../DigitransitStationPropertyMapper.java | 4 +- .../layers/stations/StationsLayerBuilder.java | 2 +- ...DigitransitRealtimeStopPropertyMapper.java | 2 +- .../stops/DigitransitStopPropertyMapper.java | 4 +- .../apis/gtfs/datafetchers/AgencyImpl.java | 2 +- .../apis/gtfs/datafetchers/AlertImpl.java | 26 ++-- .../apis/gtfs/datafetchers/FeedImpl.java | 2 +- .../apis/gtfs/datafetchers/QueryTypeImpl.java | 37 +++--- .../apis/gtfs/datafetchers/RouteImpl.java | 6 +- .../apis/gtfs/datafetchers/RouteTypeImpl.java | 2 +- .../apis/gtfs/datafetchers/StopImpl.java | 24 ++-- .../apis/gtfs/datafetchers/TripImpl.java | 6 +- .../filter/PatternByDateFilterUtil.java | 2 +- .../transmodel/TransmodelGraphQLSchema.java | 33 +++-- .../model/framework/AuthorityType.java | 2 +- .../model/framework/OperatorType.java | 4 +- .../model/network/GroupOfLinesType.java | 4 +- .../model/network/JourneyPatternType.java | 2 +- .../transmodel/model/network/LineType.java | 40 ++++--- .../model/siri/et/EstimatedCallType.java | 4 +- .../transmodel/model/siri/sx/AffectsType.java | 12 +- .../model/siri/sx/PtSituationElementType.java | 15 +-- .../model/stop/PlaceAtDistanceType.java | 2 +- .../apis/transmodel/model/stop/QuayType.java | 8 +- .../transmodel/model/stop/StopPlaceType.java | 19 ++- .../timetable/DatedServiceJourneyQuery.java | 4 +- .../timetable/DatedServiceJourneyType.java | 2 +- .../model/timetable/ServiceJourneyType.java | 10 +- .../timetable/TimetabledPassingTimeType.java | 2 +- .../GraphInspectorVectorTileResource.java | 2 +- .../PatternConsideringNearbyStopFinder.java | 4 +- .../ScheduledTransitLegReference.java | 10 +- .../routing/TripTimeOnDateHelper.java | 8 +- .../mapping/RaptorPathToItineraryMapper.java | 2 +- .../RouteRequestToFilterChainMapper.java | 2 +- .../raptoradapter/router/TransitRouter.java | 2 +- .../transit/mappers/TransfersMapper.java | 2 +- .../transit/mappers/TransitLayerMapper.java | 4 +- .../alternativelegs/AlternativeLegs.java | 6 +- .../routing/graphfinder/PatternAtStop.java | 4 +- .../PlaceFinderTraverseVisitor.java | 4 +- .../routing/stoptimes/StopTimesHelper.java | 10 +- .../DefaultRealtimeVehicleService.java | 2 +- .../service/DefaultTransitService.java | 113 ++++++++---------- .../transit/service/TransitEditorService.java | 7 ++ .../transit/service/TransitService.java | 94 +++++++-------- .../updater/GtfsRealtimeFuzzyTripMatcher.java | 4 +- .../updater/siri/AddedTripBuilder.java | 4 +- .../updater/siri/EntityResolver.java | 18 ++- .../updater/siri/SiriFuzzyTripMatcher.java | 6 +- .../siri/SiriTimetableSnapshotSource.java | 6 +- .../updater/siri/mapper/AffectsMapper.java | 2 +- .../updater/trip/TimetableSnapshotSource.java | 20 ++-- .../VehiclePositionUpdaterRunnable.java | 6 +- .../apis/gtfs/GraphQLIntegrationTest.java | 4 +- .../model/impl/OtpTransitServiceImplTest.java | 2 +- .../graph/DefaultRoutingServiceTest.java | 18 +-- .../stoptimes/StopTimesHelperTest.java | 4 +- .../service/DefaultTransitServiceTest.java | 12 +- .../transit/speed_test/SpeedTest.java | 4 +- .../siri/SiriTimetableSnapshotSourceTest.java | 28 ++--- .../updater/trip/RealtimeTestEnvironment.java | 10 +- .../trip/TimetableSnapshotSourceTest.java | 6 +- .../trip/moduletests/addition/AddedTest.java | 10 +- .../trip/moduletests/delay/DelayedTest.java | 4 +- .../trip/moduletests/delay/SkippedTest.java | 8 +- 79 files changed, 387 insertions(+), 427 deletions(-) diff --git a/application/src/ext-test/java/org/opentripplanner/ext/geocoder/LuceneIndexTest.java b/application/src/ext-test/java/org/opentripplanner/ext/geocoder/LuceneIndexTest.java index 18d61a3db42..3aee149999b 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/geocoder/LuceneIndexTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/geocoder/LuceneIndexTest.java @@ -135,7 +135,7 @@ static void setup() { .build(); @Override - public List getModesOfStopLocation(StopLocation stop) { + public List findTransitModes(StopLocation stop) { if (stop.getGtfsVehicleType() != null) { return List.of(stop.getGtfsVehicleType()); } else { @@ -144,7 +144,7 @@ public List getModesOfStopLocation(StopLocation stop) { } @Override - public Agency getAgencyForId(FeedScopedId id) { + public Agency getAgency(FeedScopedId id) { if (id.equals(BVG.getId())) { return BVG; } @@ -152,7 +152,7 @@ public Agency getAgencyForId(FeedScopedId id) { } @Override - public Set getRoutesForStop(StopLocation stop) { + public Set findRoutes(StopLocation stop) { return Set.of(TimetableRepositoryForTest.route("route1").withAgency(BVG).build()); } diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/TestTransitService.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/TestTransitService.java index b97cbcdc6fe..37ea737626f 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/TestTransitService.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/TestTransitService.java @@ -15,7 +15,7 @@ public TestTransitService(TimetableRepository timetableRepository) { } @Override - public Set getRoutesForStop(StopLocation stop) { + public Set findRoutes(StopLocation stop) { return Set.of( TimetableRepositoryForTest.route("1").withMode(TransitMode.RAIL).withGtfsType(100).build() ); diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java index 103a27e7554..46d9e527980 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java @@ -192,7 +192,7 @@ public TransitStopVertex getStopVertexForStopId(FeedScopedId stopId) { @Override public Collection getTransfersFromStop(StopLocation stop) { - return transitService.getTransfersByStop(stop); + return transitService.findPathTransfers(stop); } @Override @@ -207,7 +207,7 @@ public Collection getTransfersToStop(StopLocation stop) { @Override public boolean isDateActive(FlexServiceDate date, FlexTrip trip) { - int serviceCode = transitService.getServiceCodeForId(trip.getTrip().getServiceId()); + int serviceCode = transitService.getServiceCode(trip.getTrip().getServiceId()); return date.isTripServiceRunning(serviceCode); } } diff --git a/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java b/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java index 3a6546cfe1e..daecb7f6a4e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java @@ -174,7 +174,7 @@ private static Optional map(List stopLocations) } private List agenciesForStopLocation(StopLocation stop) { - return transitService.getRoutesForStop(stop).stream().map(Route::getAgency).distinct().toList(); + return transitService.findRoutes(stop).stream().map(Route::getAgency).distinct().toList(); } private List agenciesForStopLocationsGroup(StopLocationsGroup group) { @@ -190,7 +190,7 @@ StopCluster.Location toLocation(FeedScopedId id) { var loc = transitService.getStopLocation(id); if (loc != null) { var feedPublisher = toFeedPublisher(transitService.getFeedInfo(id.getFeedId())); - var modes = transitService.getModesOfStopLocation(loc).stream().map(Enum::name).toList(); + var modes = transitService.findTransitModes(loc).stream().map(Enum::name).toList(); var agencies = agenciesForStopLocation(loc) .stream() .map(StopClusterMapper::toAgency) @@ -209,7 +209,7 @@ StopCluster.Location toLocation(FeedScopedId id) { var group = transitService.getStopLocationsGroup(id); var feedPublisher = toFeedPublisher(transitService.getFeedInfo(id.getFeedId())); var modes = transitService - .getModesOfStopLocationsGroup(group) + .findTransitModes(group) .stream() .map(Enum::name) .toList(); diff --git a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java index 7f819c70792..338d425db9a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java @@ -41,9 +41,9 @@ public static GraphStats build(OtpServerRequestContext context) { new StreetStats(edgeTypes, vertexTypes), new TransitStats( stopCounts, - transitService.getAllTrips().size(), - transitService.getAllTripPatterns().size(), - transitService.getAllRoutes().size(), + transitService.listTrips().size(), + transitService.listTripPatterns().size(), + transitService.listRoutes().size(), constrainedTransferCounts ) ); diff --git a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java index cff5d2f791e..e9b5ac8a236 100644 --- a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java +++ b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java @@ -152,7 +152,7 @@ private TxPoint pointInfo(TransferPoint p, boolean boarding) { if (p instanceof TripTransferPoint tp) { var trip = tp.getTrip(); var route = trip.getRoute(); - var ptn = transitService.getPatternForTrip(trip); + var ptn = transitService.findPattern(trip); r.operator = getName(trip.getOperator()); r.type = "Trip"; r.entityId = trip.getId().getId(); @@ -162,7 +162,7 @@ private TxPoint pointInfo(TransferPoint p, boolean boarding) { addLocation(r, ptn, stop, trip, boarding); } else if (p instanceof RouteStopTransferPoint rp) { var route = rp.getRoute(); - var ptn = transitService.getPatternsForRoute(route).stream().findFirst().orElse(null); + var ptn = transitService.findPatterns(route).stream().findFirst().orElse(null); r.operator = getName(route.getOperator()); r.type = "Route"; r.entityId = route.getId().getId(); diff --git a/application/src/ext/java/org/opentripplanner/ext/reportapi/resource/ReportResource.java b/application/src/ext/java/org/opentripplanner/ext/reportapi/resource/ReportResource.java index e06aec71b53..56a224d3d68 100644 --- a/application/src/ext/java/org/opentripplanner/ext/reportapi/resource/ReportResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/reportapi/resource/ReportResource.java @@ -49,7 +49,7 @@ public String getTransfersAsCsv() { @Produces(MediaType.TEXT_PLAIN) public String getTransitGroupPriorities() { return TransitGroupPriorityReport.build( - transitService.getAllTripPatterns(), + transitService.listTripPatterns(), defaultRequest.journey().transit() ); } diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java index a0bbb1116b3..1500799204e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java @@ -43,7 +43,7 @@ public ApiRouterInfo( this.buildTime = Date.from(graph.buildTime); this.transitServiceStarts = transitService.getTransitServiceStarts().toEpochSecond(); this.transitServiceEnds = transitService.getTransitServiceEnds().toEpochSecond(); - this.transitModes = ModeMapper.mapToApi(transitService.getTransitModes()); + this.transitModes = ModeMapper.mapToApi(transitService.listTransitModes()); this.envelope = envelope; this.hasBikeSharing = mapHasBikeSharing(vehicleRentalService); this.hasBikePark = mapHasBikePark(vehicleParkingService); diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java index cf424392d70..ce01a4f61a2 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiTravelOptionsMaker.java @@ -33,7 +33,7 @@ public static List makeOptions( ) { var service = graph.getVehicleParkingService(); return makeOptions( - transitService.getTransitModes(), + transitService.listTransitModes(), vehicleRentalService.hasRentalBikes(), service.hasBikeParking(), service.hasCarParking() diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java index ccf18217148..7dbfabed156 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java @@ -93,7 +93,7 @@ public IndexAPI( @GET @Path("/feeds") public Collection getFeeds() { - return transitService().getFeedIds(); + return transitService().listFeedIds(); } @GET @@ -108,7 +108,7 @@ public ApiFeedInfo getFeedInfo(@PathParam("feedId") String feedId) { @Path("/agencies/{feedId}") public Collection getAgencies(@PathParam("feedId") String feedId) { Collection agencies = transitService() - .getAgencies() + .listAgencies() .stream() .filter(agency -> agency.getId().getFeedId().equals(feedId)) .collect(Collectors.toList()); @@ -138,7 +138,7 @@ public Response getAgencyRoutes( var agency = agency(feedId, agencyId); Collection routes = transitService() - .getAllRoutes() + .listRoutes() .stream() .filter(r -> r.getAgency() == agency) .collect(Collectors.toList()); @@ -235,7 +235,7 @@ public List getStopsInRadius( public List getRoutesForStop(@PathParam("stopId") String stopId) { var stop = stop(stopId); return transitService() - .getPatternsForStop(stop) + .findPatterns(stop) .stream() .map(TripPattern::getRoute) .map(RouteMapper::mapToApiShort) @@ -247,7 +247,7 @@ public List getRoutesForStop(@PathParam("stopId") String stopId) public List getPatternsForStop(@PathParam("stopId") String stopId) { var stop = stop(stopId); return transitService() - .getPatternsForStop(stop) + .findPatterns(stop) .stream() .map(TripPatternMapper::mapToApiShort) .collect(Collectors.toList()); @@ -275,7 +275,7 @@ public Collection getStopTimesForStop( : Instant.ofEpochSecond(startTimeSeconds); return transitService() - .stopTimesForStop( + .findStopTimesInPattern( stop(stopIdString), startTime, Duration.ofSeconds(timeRange), @@ -303,7 +303,7 @@ public List getStoptimesForStopAndDate( var stop = stop(stopId); var serviceDate = parseServiceDate("date", date); List stopTimes = transitService() - .getStopTimesForStop( + .findStopTimesInPattern( stop, serviceDate, omitNonPickups ? ArrivalDeparture.DEPARTURES : ArrivalDeparture.BOTH, @@ -322,7 +322,7 @@ public Collection getTransfers(@PathParam("stopId") String stopId) // get the transfers for the stop return transitService() - .getTransfersByStop(stop) + .findPathTransfers(stop) .stream() .map(TransferMapper::mapToApi) .collect(Collectors.toList()); @@ -344,7 +344,7 @@ public Collection getAlertsForStop(@PathParam("stopId") String stopId) @GET @Path("/routes") public List getRoutes(@QueryParam("hasStop") List stopIds) { - Collection routes = transitService().getAllRoutes(); + Collection routes = transitService().listRoutes(); // Filter routes to include only those that pass through all given stops if (stopIds != null) { // Protective copy, we are going to calculate the intersection destructively @@ -352,7 +352,7 @@ public List getRoutes(@QueryParam("hasStop") List stopIds for (String stopId : stopIds) { var stop = stop(stopId); Set routesHere = new HashSet<>(); - for (TripPattern pattern : transitService().getPatternsForStop(stop)) { + for (TripPattern pattern : transitService().findPatterns(stop)) { routesHere.add(pattern.getRoute()); } routes.retainAll(routesHere); @@ -372,7 +372,7 @@ public ApiRoute getRoute(@PathParam("routeId") String routeId) { @GET @Path("/routes/{routeId}/patterns") public List getPatternsForRoute(@PathParam("routeId") String routeId) { - Collection patterns = transitService().getPatternsForRoute(route(routeId)); + Collection patterns = transitService().findPatterns(route(routeId)); return TripPatternMapper.mapToApiShort(patterns); } @@ -383,7 +383,7 @@ public List getStopsForRoute(@PathParam("routeId") String routeId) var route = route(routeId); Set stops = new HashSet<>(); - Collection patterns = transitService().getPatternsForRoute(route); + Collection patterns = transitService().findPatterns(route); for (TripPattern pattern : patterns) { stops.addAll(pattern.getStops()); } @@ -396,7 +396,7 @@ public List getStopsForRoute(@PathParam("routeId") String routeId) public List getTripsForRoute(@PathParam("routeId") String routeId) { var route = route(routeId); - var patterns = transitService().getPatternsForRoute(route); + var patterns = transitService().findPatterns(route); return patterns .stream() .flatMap(TripPattern::scheduledTripsAsStream) @@ -445,7 +445,7 @@ public List getStoptimesForTrip(@PathParam("tripId") String tr var pattern = tripPattern(trip); // Note, we need the updated timetable not the scheduled one (which contains no real-time updates). var table = transitService() - .getTimetableForTripPattern(pattern, LocalDate.now(transitService().getTimeZone())); + .findTimetable(pattern, LocalDate.now(transitService().getTimeZone())); var tripTimesOnDate = TripTimeOnDate.fromTripTimes(table, trip); return TripTimeMapper.mapToApi(tripTimesOnDate); } @@ -472,7 +472,7 @@ public Collection getAlertsForTrip(@PathParam("tripId") String tripId) @GET @Path("/patterns") public List getPatterns() { - Collection patterns = transitService().getAllTripPatterns(); + Collection patterns = transitService().listTripPatterns(); return TripPatternMapper.mapToApiShort(patterns); } @@ -589,7 +589,7 @@ private static NotFoundException notFoundException(String entity, String details } private Agency agency(String feedId, String agencyId) { - var agency = transitService().getAgencyForId(new FeedScopedId(feedId, agencyId)); + var agency = transitService().getAgency(new FeedScopedId(feedId, agencyId)); if (agency == null) { throw notFoundException("Agency", "feedId: " + feedId + ", agencyId: " + agencyId); } @@ -602,18 +602,18 @@ private StopLocation stop(String stopId) { } private Route route(String routeId) { - var route = transitService().getRouteForId(createId("routeId", routeId)); + var route = transitService().getRoute(createId("routeId", routeId)); return validateExist("Route", route, "routeId", routeId); } private Trip trip(String tripId) { - var trip = transitService().getTripForId(createId("tripId", tripId)); + var trip = transitService().getTrip(createId("tripId", tripId)); return validateExist("Trip", trip, "tripId", tripId); } private TripPattern tripPattern(String tripPatternId) { var id = createId("patternId", tripPatternId); - var pattern = transitService().getTripPatternForId(id); + var pattern = transitService().getTripPattern(id); return validateExist("TripPattern", pattern, "patternId", tripPatternId); } @@ -622,7 +622,7 @@ private TripPattern tripPatternForTripId(String tripId) { } private TripPattern tripPattern(Trip trip) { - var pattern = transitService().getPatternForTrip(trip); + var pattern = transitService().findPattern(trip); return validateExist("TripPattern", pattern, "trip", trip.getId()); } diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java index 29701ee2307..58f9f0f9592 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/VectorTilesResource.java @@ -109,7 +109,7 @@ public TileJson getTileJson( private List getFeedInfos() { return serverContext .transitService() - .getFeedIds() + .listFeedIds() .stream() .map(serverContext.transitService()::getFeedInfo) .filter(Predicate.not(Objects::isNull)) diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/LayerFilters.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/LayerFilters.java index 7d63bbe5398..38a27d4b4c4 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/LayerFilters.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/LayerFilters.java @@ -58,7 +58,7 @@ public static Predicate forType(FilterType type, TransitService tra return switch (type) { case NONE -> NO_FILTER; case SUNDAY_TO_SUNDAY_SERVICE_WEEK -> buildCurrentServiceWeekPredicate( - transitService::getPatternsForStop, + transitService::findPatterns, trip -> transitService.getCalendarService().getServiceDatesForServiceId(trip.getServiceId()), () -> LocalDate.now(transitService.getTimeZone()) diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/areastops/AreaStopPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/areastops/AreaStopPropertyMapper.java index ea6f9225e11..3a5a33103df 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/areastops/AreaStopPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/areastops/AreaStopPropertyMapper.java @@ -28,7 +28,7 @@ protected AreaStopPropertyMapper( } protected static AreaStopPropertyMapper create(TransitService transitService, Locale locale) { - return new AreaStopPropertyMapper(transitService::getRoutesForStop, locale); + return new AreaStopPropertyMapper(transitService::findRoutes, locale); } @Override diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/DigitransitStationPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/DigitransitStationPropertyMapper.java index 18b4a5f388d..6268db83b04 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/DigitransitStationPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/DigitransitStationPropertyMapper.java @@ -44,7 +44,7 @@ public Collection map(Station station) { "type", childStops .stream() - .flatMap(stop -> transitService.getPatternsForStop(stop).stream()) + .flatMap(stop -> transitService.findPatterns(stop).stream()) .map(tripPattern -> tripPattern.getMode().name()) .distinct() .collect(Collectors.joining(",")) @@ -60,7 +60,7 @@ public Collection map(Station station) { OBJECT_MAPPER.writeValueAsString( childStops .stream() - .flatMap(stop -> transitService.getRoutesForStop(stop).stream()) + .flatMap(stop -> transitService.findRoutes(stop).stream()) .distinct() .map(route -> { var obj = OBJECT_MAPPER.createObjectNode(); diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/StationsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/StationsLayerBuilder.java index 25959d5ec7a..c157621a740 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/StationsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stations/StationsLayerBuilder.java @@ -40,7 +40,7 @@ public StationsLayerBuilder( protected List getGeometries(Envelope query) { return transitService - .getStations() + .listStations() .stream() .map(station -> { Coordinate coordinate = station.getCoordinate().asJtsCoordinate(); diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java index af2ec7212ec..6fb2783f7cb 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java @@ -36,7 +36,7 @@ protected Collection map(RegularStop stop) { var serviceDate = LocalDate.now(transitService.getTimeZone()); boolean stopTimesExist = transitService - .getStopTimesForStop(stop, serviceDate, ArrivalDeparture.BOTH, true) + .findStopTimesInPattern(stop, serviceDate, ArrivalDeparture.BOTH, true) .stream() .anyMatch(stopTime -> stopTime.times.size() > 0); diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitStopPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitStopPropertyMapper.java index edf9c7d8188..0322a2749b4 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitStopPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitStopPropertyMapper.java @@ -61,7 +61,7 @@ protected static Collection getBaseKeyValues( protected static String getRoutes(TransitService transitService, RegularStop stop) { try { var objects = transitService - .getRoutesForStop(stop) + .findRoutes(stop) .stream() .map(route -> { var routeObject = OBJECT_MAPPER.createObjectNode(); @@ -76,7 +76,7 @@ protected static String getRoutes(TransitService transitService, RegularStop sto } protected static String getType(TransitService transitService, RegularStop stop) { - Collection patternsForStop = transitService.getPatternsForStop(stop); + Collection patternsForStop = transitService.findPatterns(stop); return patternsForStop .stream() diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AgencyImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AgencyImpl.java index 8a6d55bb078..d8ed772c9e5 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AgencyImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AgencyImpl.java @@ -107,7 +107,7 @@ public DataFetcher url() { private List getRoutes(DataFetchingEnvironment environment) { return getTransitService(environment) - .getAllRoutes() + .listRoutes() .stream() .filter(route -> route.getAgency().equals(getSource(environment))) .collect(Collectors.toList()); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AlertImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AlertImpl.java index 4f7a3f61a57..d7d937d52de 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AlertImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/AlertImpl.java @@ -51,9 +51,7 @@ public DataFetcher agency() { .filter(EntitySelector.Agency.class::isInstance) .findAny() .map(EntitySelector.Agency.class::cast) - .map(entitySelector -> - getTransitService(environment).getAgencyForId(entitySelector.agencyId()) - ) + .map(entitySelector -> getTransitService(environment).getAgency(entitySelector.agencyId())) .orElse(null); } @@ -170,24 +168,24 @@ public DataFetcher> entities() { } if (entitySelector instanceof EntitySelector.Agency) { FeedScopedId id = ((EntitySelector.Agency) entitySelector).agencyId(); - Agency agency = getTransitService(environment).getAgencyForId(id); + Agency agency = getTransitService(environment).getAgency(id); return List.of(getAlertEntityOrUnknown(agency, id.toString(), "agency")); } if (entitySelector instanceof EntitySelector.Route) { FeedScopedId id = ((EntitySelector.Route) entitySelector).routeId(); - Route route = getTransitService(environment).getRouteForId(id); + Route route = getTransitService(environment).getRoute(id); return List.of(getAlertEntityOrUnknown(route, id.toString(), "route")); } if (entitySelector instanceof EntitySelector.Trip) { FeedScopedId id = ((EntitySelector.Trip) entitySelector).tripId(); - Trip trip = getTransitService(environment).getTripForId(id); + Trip trip = getTransitService(environment).getTrip(id); return List.of(getAlertEntityOrUnknown(trip, id.toString(), "trip")); } if (entitySelector instanceof EntitySelector.StopAndRoute stopAndRoute) { FeedScopedId stopId = stopAndRoute.stopId(); FeedScopedId routeId = stopAndRoute.routeId(); StopLocation stop = getTransitService(environment).getRegularStop(stopId); - Route route = getTransitService(environment).getRouteForId(routeId); + Route route = getTransitService(environment).getRoute(routeId); return List.of( stop != null && route != null ? new StopOnRouteModel(stop, route) @@ -205,7 +203,7 @@ public DataFetcher> entities() { FeedScopedId stopId = stopAndTrip.stopId(); FeedScopedId tripId = stopAndTrip.tripId(); StopLocation stop = getTransitService(environment).getRegularStop(stopId); - Trip trip = getTransitService(environment).getTripForId(tripId); + Trip trip = getTransitService(environment).getTrip(tripId); return List.of( stop != null && trip != null ? new StopOnTripModel(stop, trip) @@ -222,7 +220,7 @@ public DataFetcher> entities() { if (entitySelector instanceof EntitySelector.RouteTypeAndAgency) { FeedScopedId agencyId = ((EntitySelector.RouteTypeAndAgency) entitySelector).agencyId(); int routeType = ((EntitySelector.RouteTypeAndAgency) entitySelector).routeType(); - Agency agency = getTransitService(environment).getAgencyForId(agencyId); + Agency agency = getTransitService(environment).getAgency(agencyId); return List.of( agency != null ? new RouteTypeModel(agency, routeType, agency.getId().getFeedId()) @@ -244,10 +242,10 @@ public DataFetcher> entities() { if (entitySelector instanceof EntitySelector.DirectionAndRoute) { Direction direction = ((DirectionAndRoute) entitySelector).direction(); FeedScopedId routeId = ((EntitySelector.DirectionAndRoute) entitySelector).routeId(); - Route route = getTransitService(environment).getRouteForId(routeId); + Route route = getTransitService(environment).getRoute(routeId); return route != null ? getTransitService(environment) - .getPatternsForRoute(route) + .findPatterns(route) .stream() .filter(pattern -> pattern.getDirection() == direction) .collect(Collectors.toList()) @@ -301,9 +299,7 @@ public DataFetcher route() { .filter(entitySelector -> entitySelector instanceof EntitySelector.Route) .findAny() .map(EntitySelector.Route.class::cast) - .map(entitySelector -> - getTransitService(environment).getRouteForId(entitySelector.routeId()) - ) + .map(entitySelector -> getTransitService(environment).getRoute(entitySelector.routeId())) .orElse(null); } @@ -331,7 +327,7 @@ public DataFetcher trip() { .filter(entitySelector -> entitySelector instanceof EntitySelector.Trip) .findAny() .map(EntitySelector.Trip.class::cast) - .map(entitySelector -> getTransitService(environment).getTripForId(entitySelector.tripId())) + .map(entitySelector -> getTransitService(environment).getTrip(entitySelector.tripId())) .orElse(null); } diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/FeedImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/FeedImpl.java index d6488d3f375..3d9458152b5 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/FeedImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/FeedImpl.java @@ -79,7 +79,7 @@ public DataFetcher publisher() { private List getAgencies(DataFetchingEnvironment environment) { String id = getSource(environment); return getTransitService(environment) - .getAgencies() + .listAgencies() .stream() .filter(agency -> agency.getId().getFeedId().equals(id)) .collect(Collectors.toList()); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java index 221df2b8ec6..140fa6da9a5 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java @@ -56,7 +56,6 @@ import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; import org.opentripplanner.routing.graphfinder.PlaceType; -import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; @@ -89,7 +88,7 @@ public class QueryTypeImpl implements GraphQLDataFetchers.GraphQLQueryType { @Override public DataFetcher> agencies() { - return environment -> getTransitService(environment).getAgencies(); + return environment -> getTransitService(environment).listAgencies(); } @Override @@ -99,7 +98,7 @@ public DataFetcher agency() { new GraphQLTypes.GraphQLQueryTypeAgencyArgs(environment.getArguments()).getGraphQLId() ); - return getTransitService(environment).getAgencyForId(id); + return getTransitService(environment).getAgency(id); }; } @@ -264,7 +263,7 @@ public DataFetcher departureRow() { @Override public DataFetcher> feeds() { - return environment -> getTransitService(environment).getFeedIds(); + return environment -> getTransitService(environment).listFeedIds(); } @Override @@ -276,7 +275,7 @@ public DataFetcher fuzzyTrip() { return new GtfsRealtimeFuzzyTripMatcher(transitService) .getTrip( - transitService.getRouteForId(FeedScopedId.parse(args.getGraphQLRoute())), + transitService.getRoute(FeedScopedId.parse(args.getGraphQLRoute())), DIRECTION_MAPPER.map(args.getGraphQLDirection()), args.getGraphQLTime(), ServiceDateUtils.parseString(args.getGraphQLDate()) @@ -393,7 +392,7 @@ public DataFetcher node() { switch (type) { case "Agency": - return transitService.getAgencyForId(FeedScopedId.parse(id)); + return transitService.getAgency(FeedScopedId.parse(id)); case "Alert": return transitService.getTransitAlertService().getAlertById(FeedScopedId.parse(id)); case "BikePark": @@ -431,7 +430,7 @@ public DataFetcher node() { case "DepartureRow": return PatternAtStop.fromId(transitService, id); case "Pattern": - return transitService.getTripPatternForId(FeedScopedId.parse(id)); + return transitService.getTripPattern(FeedScopedId.parse(id)); case "placeAtDistance": { String[] parts = id.split(";"); @@ -450,7 +449,7 @@ public DataFetcher node() { return new PlaceAtDistance(place, Double.parseDouble(parts[0])); } case "Route": - return transitService.getRouteForId(FeedScopedId.parse(id)); + return transitService.getRoute(FeedScopedId.parse(id)); case "Stop": return transitService.getRegularStop(FeedScopedId.parse(id)); case "Stoptime": @@ -467,7 +466,7 @@ public DataFetcher node() { return null; //TODO case "Trip": var scopedId = FeedScopedId.parse(id); - return transitService.getTripForId(scopedId); + return transitService.getTrip(scopedId); case "VehicleParking": var vehicleParkingId = FeedScopedId.parse(id); return vehicleParkingService == null @@ -487,7 +486,7 @@ public DataFetcher node() { public DataFetcher pattern() { return environment -> getTransitService(environment) - .getTripPatternForId( + .getTripPattern( FeedScopedId.parse( new GraphQLTypes.GraphQLQueryTypePatternArgs(environment.getArguments()).getGraphQLId() ) @@ -496,7 +495,7 @@ public DataFetcher pattern() { @Override public DataFetcher> patterns() { - return environment -> getTransitService(environment).getAllTripPatterns(); + return environment -> getTransitService(environment).listTripPatterns(); } @Override @@ -584,7 +583,7 @@ public DataFetcher> rentalVehicles() { public DataFetcher route() { return environment -> getTransitService(environment) - .getRouteForId( + .getRoute( FeedScopedId.parse( new GraphQLTypes.GraphQLQueryTypeRouteArgs(environment.getArguments()).getGraphQLId() ) @@ -603,11 +602,11 @@ public DataFetcher> routes() { .getGraphQLIds() .stream() .map(FeedScopedId::parse) - .map(transitService::getRouteForId) + .map(transitService::getRoute) .toList(); } - Stream routeStream = transitService.getAllRoutes().stream(); + Stream routeStream = transitService.listRoutes().stream(); if (args.getGraphQLFeeds() != null) { List feeds = args.getGraphQLFeeds(); @@ -652,7 +651,7 @@ public DataFetcher serviceTimeRange() { public DataFetcher station() { return environment -> getTransitService(environment) - .getStationById( + .getStation( FeedScopedId.parse( new GraphQLTypes.GraphQLQueryTypeStationArgs(environment.getArguments()).getGraphQLId() ) @@ -671,11 +670,11 @@ public DataFetcher> stations() { .getGraphQLIds() .stream() .map(FeedScopedId::parse) - .map(transitService::getStationById) + .map(transitService::getStation) .collect(Collectors.toList()); } - Stream stationStream = transitService.getStations().stream(); + Stream stationStream = transitService.listStations().stream(); if (args.getGraphQLName() != null) { String name = args.getGraphQLName().toLowerCase(environment.getLocale()); @@ -803,7 +802,7 @@ public DataFetcher> ticketTypes() { public DataFetcher trip() { return environment -> getTransitService(environment) - .getTripForId( + .getTrip( FeedScopedId.parse( new GraphQLTypes.GraphQLQueryTypeTripArgs(environment.getArguments()).getGraphQLId() ) @@ -815,7 +814,7 @@ public DataFetcher> trips() { return environment -> { var args = new GraphQLTypes.GraphQLQueryTypeTripsArgs(environment.getArguments()); - Stream tripStream = getTransitService(environment).getAllTrips().stream(); + Stream tripStream = getTransitService(environment).listTrips().stream(); if (args.getGraphQLFeeds() != null) { List feeds = args.getGraphQLFeeds(); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteImpl.java index ae6acb0a297..9b98b71bd79 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteImpl.java @@ -178,7 +178,7 @@ public DataFetcher mode() { public DataFetcher> patterns() { return environment -> { final TransitService transitService = getTransitService(environment); - var patterns = transitService.getPatternsForRoute(getSource(environment)); + var patterns = transitService.findPatterns(getSource(environment)); var args = new GraphQLTypes.GraphQLRoutePatternsArgs(environment.getArguments()); @@ -231,7 +231,7 @@ public DataFetcher url() { private Iterable getStops(DataFetchingEnvironment environment) { return getTransitService(environment) - .getPatternsForRoute(getSource(environment)) + .findPatterns(getSource(environment)) .stream() .map(TripPattern::getStops) .flatMap(Collection::stream) @@ -240,7 +240,7 @@ private Iterable getStops(DataFetchingEnvironment environment) { private Iterable getTrips(DataFetchingEnvironment environment) { return getTransitService(environment) - .getPatternsForRoute(getSource(environment)) + .findPatterns(getSource(environment)) .stream() .flatMap(TripPattern::scheduledTripsAsStream) .collect(Collectors.toSet()); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteTypeImpl.java index bd8b9a7e019..108b4bd2bc0 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/RouteTypeImpl.java @@ -27,7 +27,7 @@ public DataFetcher> routes() { return environment -> { Agency agency = getSource(environment).getAgency(); return getTransitService(environment) - .getAllRoutes() + .listRoutes() .stream() .filter(route -> route.getId().getFeedId().equals(getSource(environment).getFeedId()) && diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java index 2d17326a0ef..5a2e6f29204 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java @@ -270,7 +270,7 @@ public DataFetcher> stopTimesForPattern() { GraphQLTypes.GraphQLStopStopTimesForPatternArgs args = new GraphQLTypes.GraphQLStopStopTimesForPatternArgs( environment.getArguments() ); - TripPattern pattern = transitService.getTripPatternForId( + TripPattern pattern = transitService.getTripPattern( FeedScopedId.parse(args.getGraphQLId()) ); @@ -287,7 +287,7 @@ public DataFetcher> stopTimesForPattern() { ); } - return transitService.stopTimesForPatternAtStop( + return transitService.findTripTimeOnDate( stop, pattern, GraphQLUtils.getTimeOrNow(args.getGraphQLStartTime()), @@ -318,7 +318,7 @@ public DataFetcher> stoptimesForPatterns() { var args = new GraphQLTypes.GraphQLStopStoptimesForPatternsArgs(environment.getArguments()); Function> stopTFunction = stop -> - transitService.stopTimesForStop( + transitService.findStopTimesInPattern( stop, GraphQLUtils.getTimeOrNow(args.getGraphQLStartTime()), Duration.ofSeconds(args.getGraphQLTimeRange()), @@ -356,7 +356,7 @@ public DataFetcher> stoptimesForServiceDate() { } Function> stopTFunction = stop -> - transitService.getStopTimesForStop( + transitService.findStopTimesInPattern( stop, date, args.getGraphQLOmitNonPickups() ? ArrivalDeparture.DEPARTURES : ArrivalDeparture.BOTH, @@ -385,7 +385,7 @@ public DataFetcher> stoptimesWithoutPatterns() { Function> stopTFunction = stop -> transitService - .stopTimesForStop( + .findStopTimesInPattern( stop, GraphQLUtils.getTimeOrNow(args.getGraphQLStartTime()), Duration.ofSeconds(args.getGraphQLTimeRange()), @@ -431,7 +431,7 @@ public DataFetcher> transfers() { .getGraphQLMaxDistance(); return getTransitService(environment) - .getTransfersByStop(stop) + .findPathTransfers(stop) .stream() .filter(transfer -> maxDistance == null || transfer.getDistanceMeters() < maxDistance) .filter(transfer -> transfer.to instanceof RegularStop) @@ -452,14 +452,14 @@ public DataFetcher vehicleMode() { environment, stop -> transitService - .getModesOfStopLocation(stop) + .findTransitModes(stop) .stream() .findFirst() .map(Enum::toString) .orElse(null), station -> transitService - .getModesOfStopLocationsGroup(station) + .findTransitModes(station) .stream() .findFirst() .map(Enum::toString) @@ -495,7 +495,7 @@ public DataFetcher zoneId() { private Collection getPatterns(DataFetchingEnvironment environment) { return getValue( environment, - stop -> getTransitService(environment).getPatternsForStop(stop, true), + stop -> getTransitService(environment).findPatterns(stop, true), station -> null ); } @@ -503,7 +503,7 @@ private Collection getPatterns(DataFetchingEnvironment environment) private Collection getRoutes(DataFetchingEnvironment environment) { return getValue( environment, - stop -> getTransitService(environment).getRoutesForStop(stop), + stop -> getTransitService(environment).findRoutes(stop), station -> null ); } @@ -531,7 +531,7 @@ private List getTripTimeOnDatesForPatternAtStopIncludingTripsWit ) .flatMap(tripPattern -> transitService - .stopTimesForPatternAtStop( + .findTripTimeOnDate( stop, tripPattern, startTime, @@ -562,7 +562,7 @@ private Stream getRealtimeAddedPatternsAsStream( ) { return originalPattern .scheduledTripsAsStream() - .map(trip -> transitService.getNewTripPatternForModifiedTrip(trip.getId(), date)) + .map(trip -> transitService.findNewTripPatternForModifiedTrip(trip.getId(), date)) .filter(tripPattern -> tripPattern != null && tripPattern.isModifiedFromTripPatternWithEqualStops(originalPattern) ); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java index 956b35309e2..8eca58b69e0 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java @@ -325,14 +325,14 @@ public DataFetcher> stoptimesForDate() { ? ServiceDateUtils.parseString(args.getGraphQLServiceDate()) : LocalDate.now(timeZone); - TripPattern tripPattern = transitService.getPatternForTrip(trip, serviceDate); + TripPattern tripPattern = transitService.findPattern(trip, serviceDate); // no matching pattern found if (tripPattern == null) { return List.of(); } Instant midnight = ServiceDateUtils.asStartOfService(serviceDate, timeZone).toInstant(); - Timetable timetable = transitService.getTimetableForTripPattern(tripPattern, serviceDate); + Timetable timetable = transitService.findTimetable(tripPattern, serviceDate); return TripTimeOnDate.fromTripTimes(timetable, trip, serviceDate, midnight); } catch (ParseException e) { return null; // Invalid date format @@ -397,7 +397,7 @@ private Route getRoute(DataFetchingEnvironment environment) { } private TripPattern getTripPattern(DataFetchingEnvironment environment) { - return getTransitService(environment).getPatternForTrip(environment.getSource()); + return getTransitService(environment).findPattern(environment.getSource()); } private TransitService getTransitService(DataFetchingEnvironment environment) { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/support/filter/PatternByDateFilterUtil.java b/application/src/main/java/org/opentripplanner/apis/gtfs/support/filter/PatternByDateFilterUtil.java index f3c0d6d0352..c0640aec2b9 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/support/filter/PatternByDateFilterUtil.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/support/filter/PatternByDateFilterUtil.java @@ -16,7 +16,7 @@ public static PatternByServiceDatesFilter ofGraphQL( ) { return new PatternByServiceDatesFilter( new LocalDateRange(range.getGraphQLStart(), range.getGraphQLEnd()), - transitService::getPatternsForRoute, + transitService::findPatterns, trip -> transitService.getCalendarService().getServiceDatesForServiceId(trip.getServiceId()) ); } diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java index 2ffb9941bc6..b2876c384d9 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java @@ -467,13 +467,10 @@ private GraphQLSchema create() { } TransitService transitService = GqlUtil.getTransitService(env); return transitService - .getStations() + .listStations() .stream() .map(station -> - new MonoOrMultiModalStation( - station, - transitService.getMultiModalStationForStation(station) - ) + new MonoOrMultiModalStation(station, transitService.findMultiModalStation(station)) ) .collect(Collectors.toList()); }) @@ -697,7 +694,7 @@ private GraphQLSchema create() { boolean filterByInUse = TRUE.equals(environment.getArgument("filterByInUse")); boolean inUse = !GqlUtil .getTransitService(environment) - .getPatternsForStop(stop, true) + .findPatterns(stop, true) .isEmpty(); return !filterByInUse || inUse; }) @@ -965,7 +962,7 @@ private GraphQLSchema create() { if (placeAtDistance.place() instanceof StopLocation stop) { return !GqlUtil .getTransitService(environment) - .getPatternsForStop(stop, true) + .findPatterns(stop, true) .isEmpty(); } else { return true; @@ -1012,7 +1009,7 @@ private GraphQLSchema create() { .dataFetcher(environment -> { return GqlUtil .getTransitService(environment) - .getAgencyForId(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))); + .getAgency(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))); }) .build() ) @@ -1024,7 +1021,7 @@ private GraphQLSchema create() { .withDirective(TransmodelDirectives.TIMING_DATA) .type(new GraphQLNonNull(new GraphQLList(authorityType))) .dataFetcher(environment -> { - return new ArrayList<>(GqlUtil.getTransitService(environment).getAgencies()); + return new ArrayList<>(GqlUtil.getTransitService(environment).listAgencies()); }) .build() ) @@ -1045,7 +1042,7 @@ private GraphQLSchema create() { .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getOperatorForId(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))) + .getOperator(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))) ) .build() ) @@ -1057,7 +1054,7 @@ private GraphQLSchema create() { .withDirective(TransmodelDirectives.TIMING_DATA) .type(new GraphQLNonNull(new GraphQLList(operatorType))) .dataFetcher(environment -> { - return new ArrayList<>(GqlUtil.getTransitService(environment).getAllOperators()); + return new ArrayList<>(GqlUtil.getTransitService(environment).listOperators()); }) .build() ) @@ -1082,7 +1079,7 @@ private GraphQLSchema create() { } return GqlUtil .getTransitService(environment) - .getRouteForId(TransitIdMapper.mapIDToDomain(id)); + .getRoute(TransitIdMapper.mapIDToDomain(id)); }) .build() ) @@ -1154,11 +1151,11 @@ private GraphQLSchema create() { return ((List) environment.getArgument("ids")).stream() .map(TransitIdMapper::mapIDToDomain) .map(id -> { - return GqlUtil.getTransitService(environment).getRouteForId(id); + return GqlUtil.getTransitService(environment).getRoute(id); }) .collect(Collectors.toList()); } - Stream stream = GqlUtil.getTransitService(environment).getAllRoutes().stream(); + Stream stream = GqlUtil.getTransitService(environment).listRoutes().stream(); if ((boolean) environment.getArgument("flexibleOnly")) { Collection flexRoutes = GqlUtil @@ -1226,7 +1223,7 @@ private GraphQLSchema create() { .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getGroupOfRoutesForId(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))) + .getGroupOfRoutes(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))) ) .build() ) @@ -1236,7 +1233,7 @@ private GraphQLSchema create() { .name("groupsOfLines") .description("Get all groups of lines") .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(groupOfLinesType)))) - .dataFetcher(environment -> GqlUtil.getTransitService(environment).getGroupsOfRoutes()) + .dataFetcher(environment -> GqlUtil.getTransitService(environment).listGroupsOfRoutes()) .build() ) .field( @@ -1256,7 +1253,7 @@ private GraphQLSchema create() { .dataFetcher(environment -> { return GqlUtil .getTransitService(environment) - .getTripForId(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))); + .getTrip(TransitIdMapper.mapIDToDomain(environment.getArgument("id"))); }) .build() ) @@ -1313,7 +1310,7 @@ private GraphQLSchema create() { List authorities = environment.getArgumentOrDefault("authorities", List.of()); TransitService transitService = GqlUtil.getTransitService(environment); return transitService - .getAllTrips() + .listTrips() .stream() .filter(t -> lineIds.isEmpty() || lineIds.contains(t.getRoute().getId())) .filter(t -> diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/AuthorityType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/AuthorityType.java index baae947e345..d18b4da554f 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/AuthorityType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/AuthorityType.java @@ -68,7 +68,7 @@ public static GraphQLObjectType create( .type(new GraphQLNonNull(new GraphQLList(lineType))) .dataFetcher(environment -> getTransitService(environment) - .getAllRoutes() + .listRoutes() .stream() .filter(route -> Objects.equals(route.getAgency(), environment.getSource())) .collect(Collectors.toList()) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/OperatorType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/OperatorType.java index 8f55bea52ab..de58643f5dc 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/OperatorType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/OperatorType.java @@ -52,7 +52,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getAllRoutes() + .listRoutes() .stream() .filter(route -> Objects.equals(route.getOperator(), environment.getSource())) .collect(Collectors.toList()) @@ -68,7 +68,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getAllTrips() + .listTrips() .stream() .filter(trip -> Objects.equals(trip.getOperator(), environment.getSource())) .collect(Collectors.toList()) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java index 0339269dbd8..edd69e20853 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java @@ -70,9 +70,7 @@ public static GraphQLObjectType create() { .name("lines") .description("All lines part of this group of lines") .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(LineType.REF)))) - .dataFetcher(env -> - GqlUtil.getTransitService(env).getRoutesForGroupOfRoutes(env.getSource()) - ) + .dataFetcher(env -> GqlUtil.getTransitService(env).findGroupsOfRoutes(env.getSource())) .build() ) .build(); diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/JourneyPatternType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/JourneyPatternType.java index 4ed3871ff8c..dfde7427e5f 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/JourneyPatternType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/JourneyPatternType.java @@ -166,7 +166,7 @@ public static GraphQLObjectType create( .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(noticeType)))) .dataFetcher(environment -> { TripPattern tripPattern = environment.getSource(); - return GqlUtil.getTransitService(environment).getNoticesByEntity(tripPattern); + return GqlUtil.getTransitService(environment).findNotices(tripPattern); }) .build() ) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/LineType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/LineType.java index 32ea357a0aa..9aa129b2abd 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/LineType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/LineType.java @@ -46,7 +46,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("id") .type(new GraphQLNonNull(Scalars.GraphQLID)) - .dataFetcher(environment -> TransitIdMapper.mapEntityIDToApi(environment.getSource())) + .dataFetcher(environment -> TransitIdMapper.mapEntityIDToApi(getSource(environment))) .build() ) .field( @@ -54,7 +54,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("authority") .type(authorityType) - .dataFetcher(environment -> (((Route) environment.getSource()).getAgency())) + .dataFetcher(environment -> (getSource(environment).getAgency())) .build() ) .field( @@ -62,7 +62,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("operator") .type(operatorType) - .dataFetcher(environment -> (((Route) environment.getSource()).getOperator())) + .dataFetcher(environment -> ((getSource(environment)).getOperator())) .build() ) .field( @@ -70,7 +70,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("branding") .type(brandingType) - .dataFetcher(environment -> ((Route) environment.getSource()).getBranding()) + .dataFetcher(environment -> (getSource(environment)).getBranding()) ) .field( GraphQLFieldDefinition @@ -80,7 +80,7 @@ public static GraphQLObjectType create( .description( "Publicly announced code for line, differentiating it from other lines for the same operator." ) - .dataFetcher(environment -> (((Route) environment.getSource()).getShortName())) + .dataFetcher(environment -> ((getSource(environment)).getShortName())) .build() ) .field( @@ -88,7 +88,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("name") .type(Scalars.GraphQLString) - .dataFetcher(environment -> ((Route) environment.getSource()).getLongName()) + .dataFetcher(environment -> (getSource(environment)).getLongName()) .build() ) .field( @@ -96,7 +96,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("transportMode") .type(EnumTypes.TRANSPORT_MODE) - .dataFetcher(environment -> ((Route) environment.getSource()).getMode()) + .dataFetcher(environment -> (getSource(environment)).getMode()) .build() ) .field( @@ -105,9 +105,7 @@ public static GraphQLObjectType create( .name("transportSubmode") .type(EnumTypes.TRANSPORT_SUBMODE) .dataFetcher(environment -> - TransmodelTransportSubmode.fromValue( - ((Route) environment.getSource()).getNetexSubmode() - ) + TransmodelTransportSubmode.fromValue((getSource(environment)).getNetexSubmode()) ) .build() ) @@ -116,7 +114,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("description") .type(Scalars.GraphQLString) - .dataFetcher(environment -> ((Route) environment.getSource()).getDescription()) + .dataFetcher(environment -> (getSource(environment)).getDescription()) .build() ) .field( @@ -143,7 +141,7 @@ public static GraphQLObjectType create( .name("journeyPatterns") .type(new GraphQLList(journeyPatternType)) .dataFetcher(environment -> - GqlUtil.getTransitService(environment).getPatternsForRoute(environment.getSource()) + GqlUtil.getTransitService(environment).findPatterns(getSource(environment)) ) .build() ) @@ -155,7 +153,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getPatternsForRoute(environment.getSource()) + .findPatterns(getSource(environment)) .stream() .map(TripPattern::getStops) .flatMap(Collection::stream) @@ -172,7 +170,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getPatternsForRoute(environment.getSource()) + .findPatterns(getSource(environment)) .stream() .flatMap(TripPattern::scheduledTripsAsStream) .distinct() @@ -186,8 +184,8 @@ public static GraphQLObjectType create( .name("notices") .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(noticeType)))) .dataFetcher(environment -> { - Route route = environment.getSource(); - return GqlUtil.getTransitService(environment).getNoticesByEntity(route); + Route route = getSource(environment); + return GqlUtil.getTransitService(environment).findNotices(route); }) .build() ) @@ -201,7 +199,7 @@ public static GraphQLObjectType create( GqlUtil .getTransitService(environment) .getTransitAlertService() - .getRouteAlerts(((Route) environment.getSource()).getId()) + .getRouteAlerts((getSource(environment)).getId()) ) .build() ) @@ -211,7 +209,7 @@ public static GraphQLObjectType create( .name("flexibleLineType") .description("Type of flexible line, or null if line is not flexible.") .type(Scalars.GraphQLString) - .dataFetcher(environment -> ((Route) environment.getSource()).getFlexibleLineType()) + .dataFetcher(environment -> (getSource(environment)).getFlexibleLineType()) .build() ) .field( @@ -232,9 +230,13 @@ public static GraphQLObjectType create( .name("groupOfLines") .description("Groups of lines that line is a part of.") .type(new GraphQLNonNull(new GraphQLList(groupOfLinesType))) - .dataFetcher(environment -> ((Route) environment.getSource()).getGroupsOfRoutes()) + .dataFetcher(environment -> (getSource(environment)).getGroupsOfRoutes()) .build() ) .build(); } + + private static Route getSource(DataFetchingEnvironment environment) { + return environment.getSource(); + } } diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java index a0a904a0ae0..64ceb9dde2d 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java @@ -295,7 +295,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getTripOnServiceDateForTripAndDay( + .findTripOnServiceDate( new TripIdAndServiceDate( environment.getSource().getTrip().getId(), environment.getSource().getServiceDay() @@ -321,7 +321,7 @@ public static GraphQLObjectType create( TripTimeOnDate tripTimeOnDate = environment.getSource(); return GqlUtil .getTransitService(environment) - .getNoticesByEntity(tripTimeOnDate.getStopTimeKey()); + .findNotices(tripTimeOnDate.getStopTimeKey()); }) .build() ) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java index 58bf9d3f958..319df8988e3 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java @@ -72,7 +72,7 @@ public static GraphQLOutputType create( .type(lineType) .dataFetcher(environment -> { var routeId = environment.getSource().routeId(); - return GqlUtil.getTransitService(environment).getRouteForId(routeId); + return GqlUtil.getTransitService(environment).getRoute(routeId); }) .build() ) @@ -88,7 +88,7 @@ public static GraphQLOutputType create( .type(serviceJourneyType) .dataFetcher(environment -> { var tripId = environment.getSource().tripId(); - return GqlUtil.getTransitService(environment).getTripForId(tripId); + return GqlUtil.getTransitService(environment).getTrip(tripId); }) .build() ) @@ -109,7 +109,7 @@ public static GraphQLOutputType create( EntitySelector.Trip entitySelector = environment.getSource(); return GqlUtil .getTransitService(environment) - .getTripOnServiceDateForTripAndDay( + .findTripOnServiceDate( new TripIdAndServiceDate(entitySelector.tripId(), entitySelector.serviceDate()) ); }) @@ -149,7 +149,7 @@ public static GraphQLOutputType create( .type(lineType) .dataFetcher(environment -> { var routeId = environment.getSource().routeId(); - return GqlUtil.getTransitService(environment).getRouteForId(routeId); + return GqlUtil.getTransitService(environment).getRoute(routeId); }) .build() ) @@ -196,7 +196,7 @@ public static GraphQLOutputType create( .type(serviceJourneyType) .dataFetcher(environment -> { var tripId = environment.getSource().tripId(); - return GqlUtil.getTransitService(environment).getTripForId(tripId); + return GqlUtil.getTransitService(environment).getTrip(tripId); }) .build() ) @@ -219,7 +219,7 @@ public static GraphQLOutputType create( EntitySelector.StopAndTrip entitySelector = environment.getSource(); return GqlUtil .getTransitService(environment) - .getTripOnServiceDateForTripAndDay( + .findTripOnServiceDate( new TripIdAndServiceDate(entitySelector.tripId(), entitySelector.serviceDate()) ); }) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/PtSituationElementType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/PtSituationElementType.java index 4fd9505b73e..4d8e4ed6390 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/PtSituationElementType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/PtSituationElementType.java @@ -69,7 +69,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .getAgencyForId( + .getAgency( ((TransitAlert) environment.getSource()).entities() .stream() .filter(EntitySelector.Agency.class::isInstance) @@ -94,7 +94,7 @@ public static GraphQLObjectType create( .filter(EntitySelector.Route.class::isInstance) .map(EntitySelector.Route.class::cast) .map(EntitySelector.Route::routeId) - .map(transitService::getRouteForId) + .map(transitService::getRoute) .collect(Collectors.toList()); }) .build() @@ -112,7 +112,7 @@ public static GraphQLObjectType create( .filter(EntitySelector.Trip.class::isInstance) .map(EntitySelector.Trip.class::cast) .map(EntitySelector.Trip::tripId) - .map(transitService::getTripForId) + .map(transitService::getTrip) .collect(Collectors.toList()); }) .build() @@ -149,13 +149,10 @@ public static GraphQLObjectType create( .filter(EntitySelector.Stop.class::isInstance) .map(EntitySelector.Stop.class::cast) .map(EntitySelector.Stop::stopId) - .map(transitService::getStationById) + .map(transitService::getStation) .filter(Objects::nonNull) .map(station -> - new MonoOrMultiModalStation( - station, - transitService.getMultiModalStationForStation(station) - ) + new MonoOrMultiModalStation(station, transitService.findMultiModalStation(station)) ) .toList(); }) @@ -361,7 +358,7 @@ public static GraphQLObjectType create( } return GqlUtil .getTransitService(environment) - .getAgencies() + .listAgencies() .stream() .filter(agency -> agency.getId().getFeedId().equals(feedId)) .filter(agency -> agency.getId().getId().startsWith(codespace)) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceAtDistanceType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceAtDistanceType.java index 809164e9cd2..882c1491bb7 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceAtDistanceType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/PlaceAtDistanceType.java @@ -119,7 +119,7 @@ private static Stream getStopPlaces( List res = new ArrayList<>(); - MultiModalStation multiModalStation = transitService.getMultiModalStationForStation(stopPlace); + MultiModalStation multiModalStation = transitService.findMultiModalStation(stopPlace); if ( "child".equals(multiModalMode) || "all".equals(multiModalMode) || multiModalStation == null diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/QuayType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/QuayType.java index e12775936bd..bea8f5de6bf 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/QuayType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/QuayType.java @@ -124,7 +124,7 @@ public static GraphQLObjectType create( if (station != null) { return new MonoOrMultiModalStation( station, - GqlUtil.getTransitService(env).getMultiModalStationForStation(station) + GqlUtil.getTransitService(env).findMultiModalStation(station) ); } else { return null; @@ -177,7 +177,7 @@ public static GraphQLObjectType create( .dataFetcher(env -> GqlUtil .getTransitService(env) - .getPatternsForStop(env.getSource(), true) + .findPatterns(env.getSource(), true) .stream() .map(TripPattern::getRoute) .distinct() @@ -192,9 +192,7 @@ public static GraphQLObjectType create( .withDirective(TransmodelDirectives.TIMING_DATA) .description("List of journey patterns servicing this quay") .type(new GraphQLNonNull(new GraphQLList(journeyPatternType))) - .dataFetcher(env -> - GqlUtil.getTransitService(env).getPatternsForStop(env.getSource(), true) - ) + .dataFetcher(env -> GqlUtil.getTransitService(env).findPatterns(env.getSource(), true)) .build() ) .field( diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/StopPlaceType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/StopPlaceType.java index 00ac5b0e11b..21739ecb2c1 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/StopPlaceType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/stop/StopPlaceType.java @@ -250,7 +250,7 @@ public static GraphQLObjectType create( .filter(stop -> { return !GqlUtil .getTransitService(environment) - .getPatternsForStop(stop, true) + .findPatterns(stop, true) .isEmpty(); }) .collect(Collectors.toList()); @@ -449,7 +449,7 @@ public static Stream getTripTimesForStop( ) { TransitService transitService = GqlUtil.getTransitService(environment); - List stopTimesInPatterns = transitService.stopTimesForStop( + List stopTimesInPatterns = transitService.findStopTimesInPattern( stop, startTimeSeconds, timeRange, @@ -514,13 +514,10 @@ public static MonoOrMultiModalStation fetchStopPlaceById( TransitService transitService = GqlUtil.getTransitService(environment); - Station station = transitService.getStationById(id); + Station station = transitService.getStation(id); if (station != null) { - return new MonoOrMultiModalStation( - station, - transitService.getMultiModalStationForStation(station) - ); + return new MonoOrMultiModalStation(station, transitService.findMultiModalStation(station)); } MultiModalStation multiModalStation = transitService.getMultiModalStation(id); @@ -568,7 +565,7 @@ public static Collection fetchStopPlaces( if ("child".equals(multiModalMode)) { return stations .map(s -> { - MultiModalStation parent = transitService.getMultiModalStationForStation(s); + MultiModalStation parent = transitService.findMultiModalStation(s); return new MonoOrMultiModalStation(s, parent); }) .collect(Collectors.toList()); @@ -577,7 +574,7 @@ public static Collection fetchStopPlaces( else if ("all".equals(multiModalMode)) { Set result = new HashSet<>(); stations.forEach(it -> { - MultiModalStation p = transitService.getMultiModalStationForStation(it); + MultiModalStation p = transitService.findMultiModalStation(it); result.add(new MonoOrMultiModalStation(it, p)); if (p != null) { result.add(new MonoOrMultiModalStation(p)); @@ -590,7 +587,7 @@ else if ("all".equals(multiModalMode)) { else if ("parent".equals(multiModalMode)) { Set result = new HashSet<>(); stations.forEach(it -> { - MultiModalStation p = transitService.getMultiModalStationForStation(it); + MultiModalStation p = transitService.findMultiModalStation(it); if (p != null) { result.add(new MonoOrMultiModalStation(p)); } else { @@ -608,7 +605,7 @@ public static boolean isStopPlaceInUse( TransitService transitService ) { for (var quay : station.getChildStops()) { - if (!transitService.getPatternsForStop(quay, true).isEmpty()) { + if (!transitService.findPatterns(quay, true).isEmpty()) { return true; } } diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java index aef659901e4..2d95c1fce17 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java @@ -34,7 +34,7 @@ public static GraphQLFieldDefinition createGetById(GraphQLOutputType datedServic .dataFetcher(environment -> { FeedScopedId id = TransitIdMapper.mapIDToDomain(environment.getArgument("id")); - return GqlUtil.getTransitService(environment).getTripOnServiceDateById(id); + return GqlUtil.getTransitService(environment).findTripOnServiceDate(id); }) .build(); } @@ -120,7 +120,7 @@ public static GraphQLFieldDefinition createQuery(GraphQLOutputType datedServiceJ return GqlUtil .getTransitService(environment) - .getTripOnServiceDates(tripOnServiceDateRequestBuilder.build()); + .findTripsOnServiceDate(tripOnServiceDateRequestBuilder.build()); }) .build(); } diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyType.java index 7fcce88c4ee..25d30f352e8 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyType.java @@ -164,7 +164,7 @@ public static GraphQLObjectType create( private static TripPattern tripPattern(DataFetchingEnvironment env) { TransitService transitService = GqlUtil.getTransitService(env); TripOnServiceDate tripOnServiceDate = tripOnServiceDate(env); - return transitService.getPatternForTrip( + return transitService.findPattern( tripOnServiceDate.getTrip(), tripOnServiceDate.getServiceDate() ); diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/ServiceJourneyType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/ServiceJourneyType.java index e61d0a12edc..952af13c2fa 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/ServiceJourneyType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/ServiceJourneyType.java @@ -175,7 +175,7 @@ public static GraphQLObjectType create( "ServiceJourney is not included in the scheduled data, null is returned." ) .type(journeyPatternType) - .dataFetcher(env -> GqlUtil.getTransitService(env).getPatternForTrip(trip(env))) + .dataFetcher(env -> GqlUtil.getTransitService(env).findPattern(trip(env))) .build() ) .field( @@ -208,7 +208,7 @@ public static GraphQLObjectType create( Integer last = environment.getArgument("last"); TransitService transitService = GqlUtil.getTransitService(environment); - TripPattern tripPattern = transitService.getPatternForTrip(trip(environment)); + TripPattern tripPattern = transitService.findPattern(trip(environment)); if (tripPattern == null) { return List.of(); @@ -242,7 +242,7 @@ public static GraphQLObjectType create( ) .dataFetcher(env -> { Trip trip = trip(env); - TripPattern tripPattern = GqlUtil.getTransitService(env).getPatternForTrip(trip); + TripPattern tripPattern = GqlUtil.getTransitService(env).findPattern(trip); if (tripPattern == null) { return List.of(); } @@ -293,7 +293,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> { TripPattern tripPattern = GqlUtil .getTransitService(environment) - .getPatternForTrip(trip(environment)); + .findPattern(trip(environment)); if (tripPattern == null) { return null; } @@ -312,7 +312,7 @@ public static GraphQLObjectType create( .newFieldDefinition() .name("notices") .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(noticeType)))) - .dataFetcher(env -> GqlUtil.getTransitService(env).getNoticesByEntity(trip(env))) + .dataFetcher(env -> GqlUtil.getTransitService(env).findNotices(trip(env))) .build() ) .field( diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TimetabledPassingTimeType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TimetabledPassingTimeType.java index 0f4a40f0750..d7b59790f8e 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TimetabledPassingTimeType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TimetabledPassingTimeType.java @@ -170,7 +170,7 @@ public static GraphQLObjectType create( TripTimeOnDate tripTimeOnDate = environment.getSource(); return GqlUtil .getTransitService(environment) - .getNoticesByEntity(tripTimeOnDate.getStopTimeKey()); + .findNotices(tripTimeOnDate.getStopTimeKey()); }) .build() ) diff --git a/application/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java b/application/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java index 26863157353..d19c25a1f47 100644 --- a/application/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java +++ b/application/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java @@ -166,7 +166,7 @@ private String tileJsonUrl(String base, List> layers) private List feedInfos() { return serverContext .transitService() - .getFeedIds() + .listFeedIds() .stream() .map(serverContext.transitService()::getFeedInfo) .filter(Predicate.not(Objects::isNull)) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java index 9abf759d076..78cd68f6565 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java @@ -1,10 +1,8 @@ package org.opentripplanner.graph_builder.module.nearbystops; -import java.time.Duration; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.opentripplanner.ext.dataoverlay.routing.DataOverlayContext; import org.opentripplanner.ext.flex.trip.FlexTrip; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.routing.api.request.RouteRequest; @@ -60,7 +58,7 @@ public List findNearbyStops( if (ts1 instanceof RegularStop) { /* Consider this destination stop as a candidate for every trip pattern passing through it. */ - for (TripPattern pattern : transitService.getPatternsForStop(ts1)) { + for (TripPattern pattern : transitService.findPatterns(ts1)) { if ( reverseDirection ? pattern.canAlight(nearbyStop.stop) diff --git a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java index 422a62ce763..0eb6926055e 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java +++ b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java @@ -69,7 +69,7 @@ public ScheduledTransitLeg getLeg(TransitService transitService) { Trip trip; TripOnServiceDate tripOnServiceDate = null; if (tripOnServiceDateId != null) { - tripOnServiceDate = transitService.getTripOnServiceDateById(tripOnServiceDateId); + tripOnServiceDate = transitService.findTripOnServiceDate(tripOnServiceDateId); if (tripOnServiceDate == null) { LOG.info( "Invalid transit leg reference: trip on service date '{}' not found", @@ -87,14 +87,14 @@ public ScheduledTransitLeg getLeg(TransitService transitService) { } trip = tripOnServiceDate.getTrip(); } else { - trip = transitService.getTripForId(tripId); + trip = transitService.getTrip(tripId); if (trip == null) { LOG.info("Invalid transit leg reference: trip '{}' not found", tripId); return null; } } - TripPattern tripPattern = transitService.getPatternForTrip(trip, serviceDate); + TripPattern tripPattern = transitService.findPattern(trip, serviceDate); if (tripPattern == null) { LOG.info( "Invalid transit leg reference: trip pattern not found for trip '{}' and service date {} ", @@ -130,7 +130,7 @@ public ScheduledTransitLeg getLeg(TransitService transitService) { return null; } - Timetable timetable = transitService.getTimetableForTripPattern(tripPattern, serviceDate); + Timetable timetable = transitService.findTimetable(tripPattern, serviceDate); TripTimes tripTimes = timetable.getTripTimes(trip); if (tripTimes == null) { @@ -177,7 +177,7 @@ public ScheduledTransitLeg getLeg(TransitService transitService) { new AlertToLegMapper( transitService.getTransitAlertService(), - transitService::getMultiModalStationForStation + transitService::findMultiModalStation ) .addTransitAlertsToLeg(leg, false); diff --git a/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java b/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java index f2806d0a1f2..feb5191a612 100644 --- a/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java +++ b/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java @@ -23,9 +23,9 @@ public static List getTripTimeOnDates( Trip trip, LocalDate serviceDate ) { - TripPattern pattern = transitService.getPatternForTrip(trip, serviceDate); + TripPattern pattern = transitService.findPattern(trip, serviceDate); - Timetable timetable = transitService.getTimetableForTripPattern(pattern, serviceDate); + Timetable timetable = transitService.findTimetable(pattern, serviceDate); // If realtime moved pattern back to original trip, fetch it instead if (timetable.getTripIndex(trip.getId()) == -1) { @@ -33,8 +33,8 @@ public static List getTripTimeOnDates( "Trip {} not found in realtime pattern. This should not happen, and indicates a bug.", trip ); - pattern = transitService.getPatternForTrip(trip); - timetable = transitService.getTimetableForTripPattern(pattern, serviceDate); + pattern = transitService.findPattern(trip); + timetable = transitService.findTimetable(pattern, serviceDate); } // This check is made here to avoid changing TripTimeOnDate.fromTripTimes diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java index 3819500e605..c30c7c655f8 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java @@ -279,7 +279,7 @@ private TripOnServiceDate getTripOnServiceDate(T tripSchedule) { tripSchedule.getOriginalTripTimes().getTrip().getId(), tripSchedule.getServiceDate() ); - return transitService.getTripOnServiceDateForTripAndDay(tripIdAndServiceDate); + return transitService.findTripOnServiceDate(tripIdAndServiceDate); } private boolean isFree(EgressPathLeg egressPathLeg) { diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RouteRequestToFilterChainMapper.java b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RouteRequestToFilterChainMapper.java index 695ac5a15f5..277efda3810 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RouteRequestToFilterChainMapper.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RouteRequestToFilterChainMapper.java @@ -86,7 +86,7 @@ public static ItineraryListFilterChain createFilterChain( ) .withTransitAlerts( context.transitService().getTransitAlertService(), - context.transitService()::getMultiModalStationForStation + context.transitService()::findMultiModalStation ) .withSearchWindow(earliestDepartureTimeUsed, searchWindowUsed) .withPageCursorInputSubscriber(pageCursorInputSubscriber) diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java index 2b9c0136e07..d332013d5ac 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java @@ -381,7 +381,7 @@ private TemporaryVerticesContainer createTemporaryVerticesContainer( private IntStream listStopIndexes(FeedScopedId stopLocationId) { Collection stops = serverContext .transitService() - .getStopOrChildStops(stopLocationId); + .findStopOrChildStops(stopLocationId); if (stops.isEmpty()) { throw new EntityNotFoundException( diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransfersMapper.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransfersMapper.java index 5f4e40708ef..ff47cb3ea74 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransfersMapper.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransfersMapper.java @@ -29,7 +29,7 @@ static List> mapTransfers( ArrayList list = new ArrayList<>(); - for (PathTransfer pathTransfer : transitService.getTransfersByStop(stop)) { + for (PathTransfer pathTransfer : transitService.findPathTransfers(stop)) { if (pathTransfer.to instanceof RegularStop) { int toStopIndex = pathTransfer.to.getIndex(); Transfer newTransfer; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransitLayerMapper.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransitLayerMapper.java index a056efe87df..d6f9c0709c5 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransitLayerMapper.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TransitLayerMapper.java @@ -67,7 +67,7 @@ private TransitLayer map(TransitTuningParameters tuningParameters) { LOG.info("Mapping transitLayer from TimetableRepository..."); - Collection allTripPatterns = transitService.getAllTripPatterns(); + Collection allTripPatterns = transitService.listTripPatterns(); tripPatternsByStopByDate = mapTripPatterns(allTripPatterns); @@ -109,7 +109,7 @@ private HashMap> mapTripPatterns( transitService.getServiceCodesRunningForDate() ); - Set allServiceDates = transitService.getAllServiceCodes(); + Set allServiceDates = transitService.listServiceDates(); List tripPatternForDates = Collections.synchronizedList(new ArrayList<>()); diff --git a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java index 14dc7ade982..28f19ce86b3 100644 --- a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java +++ b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java @@ -113,7 +113,7 @@ public static List getAlternativeLegs( return origins .stream() - .flatMap(stop -> transitService.getPatternsForStop(stop, true).stream()) + .flatMap(stop -> transitService.findPatterns(stop, true).stream()) .filter(tripPattern -> tripPattern.getStops().stream().anyMatch(destinations::contains)) .filter(tripPatternPredicate) .distinct() @@ -165,7 +165,7 @@ private static Stream generateLegs( var serviceDates = List.of(originalDate.minusDays(1), originalDate, originalDate.plusDays(1)); for (LocalDate serviceDate : serviceDates) { - Timetable timetable = transitService.getTimetableForTripPattern(pattern, serviceDate); + Timetable timetable = transitService.findTimetable(pattern, serviceDate); ZonedDateTime midnight = ServiceDateUtils.asStartOfService( serviceDate, transitService.getTimeZone() @@ -244,7 +244,7 @@ private static ScheduledTransitLeg mapToLeg( tripTimes.getArrivalTime(alightingPosition) ); - TripOnServiceDate tripOnServiceDate = transitService.getTripOnServiceDateForTripAndDay( + TripOnServiceDate tripOnServiceDate = transitService.findTripOnServiceDate( new TripIdAndServiceDate(tripTimeOnDate.getTrip().getId(), tripTimeOnDate.getServiceDay()) ); diff --git a/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java b/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java index c06e8bbcf91..ae1380c8f1a 100644 --- a/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java +++ b/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java @@ -48,7 +48,7 @@ public static PatternAtStop fromId(TransitService transitService, String id) { ); return new PatternAtStop( transitService.getRegularStop(stopId), - transitService.getTripPatternForId(patternId) + transitService.getTripPattern(patternId) ); } @@ -70,7 +70,7 @@ public List getStoptimes( int numberOfDepartures, ArrivalDeparture arrivalDeparture ) { - return transitService.stopTimesForPatternAtStop( + return transitService.findTripTimeOnDate( stop, pattern, startTime, diff --git a/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java b/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java index 16420a0d9eb..3a1bb32a41c 100644 --- a/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java +++ b/application/src/main/java/org/opentripplanner/routing/graphfinder/PlaceFinderTraverseVisitor.java @@ -174,7 +174,7 @@ private boolean shouldInclude(List filterByPlaceTypes, PlaceType type private boolean stopHasPatternsWithMode(RegularStop stop, Set modes) { return transitService - .getPatternsForStop(stop) + .findPatterns(stop) .stream() .map(TripPattern::getMode) .anyMatch(modes::contains); @@ -234,7 +234,7 @@ private void handleStop(RegularStop stop, double distance) { private void handlePatternsAtStop(RegularStop stop, double distance) { if (includePatternAtStops) { List patterns = transitService - .getPatternsForStop(stop) + .findPatterns(stop) .stream() .filter(pattern -> filterByModes.isEmpty() || filterByModes.contains(pattern.getMode())) .filter(pattern -> diff --git a/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java b/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java index 863e2fc6569..b8fe8c9b216 100644 --- a/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java +++ b/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java @@ -59,7 +59,7 @@ public static List stopTimesForStop( List result = new ArrayList<>(); // Fetch all patterns, including those from realtime sources - Collection patterns = transitService.getPatternsForStop(stop, true); + Collection patterns = transitService.findPatterns(stop, true); for (TripPattern pattern : patterns) { Queue pq = listTripTimeOnDatesForPatternAtStop( @@ -101,9 +101,9 @@ public static List stopTimesForStop( .asStartOfService(serviceDate, transitService.getTimeZone()) .toInstant(); - for (TripPattern pattern : transitService.getPatternsForStop(stop, true)) { + for (TripPattern pattern : transitService.findPatterns(stop, true)) { StopTimesInPattern stopTimes = new StopTimesInPattern(pattern); - Timetable tt = transitService.getTimetableForTripPattern(pattern, serviceDate); + Timetable tt = transitService.findTimetable(pattern, serviceDate); List stops = pattern.getStops(); for (int i = 0; i < stops.size(); i++) { StopLocation currStop = stops.get(i); @@ -225,7 +225,7 @@ private static Queue listTripTimeOnDatesForPatternAtStop( // Loop through all possible days for (LocalDate serviceDate : serviceDates) { - Timetable timetable = transitService.getTimetableForTripPattern(pattern, serviceDate); + Timetable timetable = transitService.findTimetable(pattern, serviceDate); ZonedDateTime midnight = ServiceDateUtils.asStartOfService(serviceDate, zoneId); int secondsSinceMidnight = ServiceDateUtils.secondsSinceStartOfService( midnight, @@ -291,7 +291,7 @@ private static boolean isReplacedByAnotherPattern( TripPattern pattern, TransitService transitService ) { - final TripPattern replacement = transitService.getNewTripPatternForModifiedTrip( + final TripPattern replacement = transitService.findNewTripPatternForModifiedTrip( trip.getId(), serviceDate ); diff --git a/application/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java b/application/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java index 17a4d22e60c..9bd5c96c899 100644 --- a/application/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java +++ b/application/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java @@ -67,7 +67,7 @@ public List getRealtimeVehicles(TripPattern pattern) { @Override public OccupancyStatus getVehicleOccupancyStatus(Trip trip) { - return getOccupancyStatus(trip.getId(), transitService.getPatternForTrip(trip)); + return getOccupancyStatus(trip.getId(), transitService.findPattern(trip)); } /** diff --git a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index 5f7cfa95524..cd4ab6155dc 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -92,18 +92,18 @@ public DefaultTransitService( } @Override - public Collection getFeedIds() { + public Collection listFeedIds() { return this.timetableRepository.getFeedIds(); } @Override - public Collection getAgencies() { + public Collection listAgencies() { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepository.getAgencies(); } @Override - public Optional findAgencyById(FeedScopedId id) { + public Optional findAgency(FeedScopedId id) { return this.timetableRepository.findAgencyById(id); } @@ -123,29 +123,23 @@ public void addFeedInfo(FeedInfo info) { } @Override - public Collection getNoticesByEntity(AbstractTransitEntity entity) { + public Collection findNotices(AbstractTransitEntity entity) { return this.timetableRepository.getNoticesByElement().get(entity); } @Override - public TripPattern getTripPatternForId(FeedScopedId id) { + public TripPattern getTripPattern(FeedScopedId id) { return this.timetableRepository.getTripPatternForId(id); } @Override - public Collection getAllTripPatterns() { + public Collection listTripPatterns() { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepository.getAllTripPatterns(); } @Override - public Collection getNotices() { - OTPRequestTimeoutException.checkForTimeout(); - return this.timetableRepository.getNoticesByElement().values(); - } - - @Override - public Station getStationById(FeedScopedId id) { + public Station getStation(FeedScopedId id) { return this.timetableRepository.getSiteRepository().getStationById(id); } @@ -155,13 +149,13 @@ public MultiModalStation getMultiModalStation(FeedScopedId id) { } @Override - public Collection getStations() { + public Collection listStations() { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepository.getSiteRepository().listStations(); } @Override - public Integer getServiceCodeForId(FeedScopedId id) { + public Integer getServiceCode(FeedScopedId id) { return this.timetableRepository.getServiceCodes().get(id); } @@ -178,7 +172,7 @@ public AreaStop getAreaStop(FeedScopedId id) { } @Override - public Agency getAgencyForId(FeedScopedId id) { + public Agency getAgency(FeedScopedId id) { return this.timetableRepositoryIndex.getAgencyForId(id); } @@ -188,7 +182,7 @@ public RegularStop getRegularStop(FeedScopedId id) { } @Override - public Route getRouteForId(FeedScopedId id) { + public Route getRoute(FeedScopedId id) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { Route realtimeAddedRoute = currentSnapshot.getRealtimeAddedRoute(id); @@ -209,31 +203,25 @@ public void addRoutes(Route route) { } @Override - public Set getRoutesForStop(StopLocation stop) { + public Set findRoutes(StopLocation stop) { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepositoryIndex.getRoutesForStop(stop); } @Override - public Collection getPatternsForStop(StopLocation stop) { + public Collection findPatterns(StopLocation stop) { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepositoryIndex.getPatternsForStop(stop); } @Override - public Collection getTripsForStop(StopLocation stop) { - OTPRequestTimeoutException.checkForTimeout(); - return this.timetableRepositoryIndex.getTripsForStop(stop); - } - - @Override - public Collection getAllOperators() { + public Collection listOperators() { OTPRequestTimeoutException.checkForTimeout(); return this.timetableRepository.getOperators(); } @Override - public Operator getOperatorForId(FeedScopedId id) { + public Operator getOperator(FeedScopedId id) { return this.timetableRepositoryIndex.getOperatorForId(id); } @@ -261,7 +249,7 @@ public StopLocation getStopLocation(FeedScopedId id) { } @Override - public Collection getStopOrChildStops(FeedScopedId id) { + public Collection findStopOrChildStops(FeedScopedId id) { return timetableRepository.getSiteRepository().findStopOrChildStops(id); } @@ -277,7 +265,7 @@ public StopLocationsGroup getStopLocationsGroup(FeedScopedId id) { } @Override - public Trip getTripForId(FeedScopedId id) { + public Trip getTrip(FeedScopedId id) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { Trip trip = currentSnapshot.getRealTimeAddedTrip(id); @@ -285,17 +273,17 @@ public Trip getTripForId(FeedScopedId id) { return trip; } } - return getScheduledTripForId(id); + return getScheduledTrip(id); } @Nullable @Override - public Trip getScheduledTripForId(FeedScopedId id) { + public Trip getScheduledTrip(FeedScopedId id) { return this.timetableRepositoryIndex.getTripForId(id); } @Override - public Collection getAllTrips() { + public Collection listTrips() { OTPRequestTimeoutException.checkForTimeout(); TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { @@ -308,7 +296,7 @@ public Collection getAllTrips() { } @Override - public Collection getAllRoutes() { + public Collection listRoutes() { OTPRequestTimeoutException.checkForTimeout(); TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { @@ -321,7 +309,7 @@ public Collection getAllRoutes() { } @Override - public TripPattern getPatternForTrip(Trip trip) { + public TripPattern findPattern(Trip trip) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripPattern realtimeAddedTripPattern = currentSnapshot.getRealTimeAddedPatternForTrip(trip); @@ -333,16 +321,16 @@ public TripPattern getPatternForTrip(Trip trip) { } @Override - public TripPattern getPatternForTrip(Trip trip, LocalDate serviceDate) { - TripPattern realtimePattern = getNewTripPatternForModifiedTrip(trip.getId(), serviceDate); + public TripPattern findPattern(Trip trip, LocalDate serviceDate) { + TripPattern realtimePattern = findNewTripPatternForModifiedTrip(trip.getId(), serviceDate); if (realtimePattern != null) { return realtimePattern; } - return getPatternForTrip(trip); + return findPattern(trip); } @Override - public Collection getPatternsForRoute(Route route) { + public Collection findPatterns(Route route) { OTPRequestTimeoutException.checkForTimeout(); Collection tripPatterns = new HashSet<>( timetableRepositoryIndex.getPatternsForRoute(route) @@ -358,7 +346,7 @@ public Collection getPatternsForRoute(Route route) { } @Override - public MultiModalStation getMultiModalStationForStation(Station station) { + public MultiModalStation findMultiModalStation(Station station) { return this.timetableRepository.getSiteRepository().getMultiModalStationForStation(station); } @@ -379,7 +367,7 @@ public MultiModalStation getMultiModalStationForStation(Station station) { * @param includeCancelledTrips If true, cancelled trips will also be included in result. */ @Override - public List stopTimesForStop( + public List findStopTimesInPattern( StopLocation stop, Instant startTime, Duration timeRange, @@ -407,7 +395,7 @@ public List stopTimesForStop( * @param serviceDate Return all departures for the specified date */ @Override - public List getStopTimesForStop( + public List findStopTimesInPattern( StopLocation stop, LocalDate serviceDate, ArrivalDeparture arrivalDeparture, @@ -439,7 +427,7 @@ public List getStopTimesForStop( * @param arrivalDeparture Filter by arrivals, departures, or both */ @Override - public List stopTimesForPatternAtStop( + public List findTripTimeOnDate( StopLocation stop, TripPattern pattern, Instant startTime, @@ -468,11 +456,8 @@ public List stopTimesForPatternAtStop( * that were updated by realtime data is both part of the TimetableRepositoryIndex and the TimetableSnapshot */ @Override - public Collection getPatternsForStop( - StopLocation stop, - boolean includeRealtimeUpdates - ) { - Set tripPatterns = new HashSet<>(getPatternsForStop(stop)); + public Collection findPatterns(StopLocation stop, boolean includeRealtimeUpdates) { + Set tripPatterns = new HashSet<>(findPatterns(stop)); if (includeRealtimeUpdates) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); @@ -484,19 +469,19 @@ public Collection getPatternsForStop( } @Override - public Collection getGroupsOfRoutes() { + public Collection listGroupsOfRoutes() { OTPRequestTimeoutException.checkForTimeout(); return timetableRepositoryIndex.getAllGroupOfRoutes(); } @Override - public Collection getRoutesForGroupOfRoutes(GroupOfRoutes groupOfRoutes) { + public Collection findGroupsOfRoutes(GroupOfRoutes groupOfRoutes) { OTPRequestTimeoutException.checkForTimeout(); return timetableRepositoryIndex.getRoutesForGroupOfRoutes(groupOfRoutes); } @Override - public GroupOfRoutes getGroupOfRoutesForId(FeedScopedId id) { + public GroupOfRoutes getGroupOfRoutes(FeedScopedId id) { return timetableRepositoryIndex.getGroupOfRoutesForId(id); } @@ -506,7 +491,7 @@ public GroupOfRoutes getGroupOfRoutesForId(FeedScopedId id) { * without making a fake routing request. */ @Override - public Timetable getTimetableForTripPattern(TripPattern tripPattern, LocalDate serviceDate) { + public Timetable findTimetable(TripPattern tripPattern, LocalDate serviceDate) { OTPRequestTimeoutException.checkForTimeout(); TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); return currentSnapshot != null @@ -515,7 +500,7 @@ public Timetable getTimetableForTripPattern(TripPattern tripPattern, LocalDate s } @Override - public TripPattern getNewTripPatternForModifiedTrip(FeedScopedId tripId, LocalDate serviceDate) { + public TripPattern findNewTripPatternForModifiedTrip(FeedScopedId tripId, LocalDate serviceDate) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot == null) { return null; @@ -546,7 +531,7 @@ private TimetableSnapshot lazyGetTimeTableSnapShot() { } @Override - public TripOnServiceDate getTripOnServiceDateById(FeedScopedId tripOnServiceDateId) { + public TripOnServiceDate findTripOnServiceDate(FeedScopedId tripOnServiceDateId) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripOnServiceDate tripOnServiceDate = currentSnapshot.getRealTimeAddedTripOnServiceDateById( @@ -560,7 +545,7 @@ public TripOnServiceDate getTripOnServiceDateById(FeedScopedId tripOnServiceDate } @Override - public Collection getAllTripOnServiceDates() { + public Collection listTripsOnServiceDate() { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { return new CollectionsView<>( @@ -572,9 +557,7 @@ public Collection getAllTripOnServiceDates() { } @Override - public TripOnServiceDate getTripOnServiceDateForTripAndDay( - TripIdAndServiceDate tripIdAndServiceDate - ) { + public TripOnServiceDate findTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripOnServiceDate tripOnServiceDate = currentSnapshot.getRealTimeAddedTripOnServiceDateForTripAndDay( @@ -594,9 +577,9 @@ public TripOnServiceDate getTripOnServiceDateForTripAndDay( * @return - A list of TripOnServiceDates */ @Override - public List getTripOnServiceDates(TripOnServiceDateRequest request) { + public List findTripsOnServiceDate(TripOnServiceDateRequest request) { Matcher matcher = TripOnServiceDateMatcherFactory.of(request); - return getAllTripOnServiceDates().stream().filter(matcher::match).toList(); + return listTripsOnServiceDate().stream().filter(matcher::match).toList(); } /** @@ -614,12 +597,12 @@ public void addTransitMode(TransitMode mode) { } @Override - public Set getTransitModes() { + public Set listTransitModes() { return this.timetableRepository.getTransitModes(); } @Override - public Collection getTransfersByStop(StopLocation stop) { + public Collection findPathTransfers(StopLocation stop) { return this.timetableRepository.getTransfersByStop(stop); } @@ -698,7 +681,7 @@ public GraphUpdaterStatus getUpdaterStatus() { } @Override - public List getModesOfStopLocationsGroup(StopLocationsGroup station) { + public List findTransitModes(StopLocationsGroup station) { return sortByOccurrenceAndReduce( station.getChildStops().stream().flatMap(this::getPatternModesOfStop) ) @@ -706,7 +689,7 @@ public List getModesOfStopLocationsGroup(StopLocationsGroup station } @Override - public List getModesOfStopLocation(StopLocation stop) { + public List findTransitModes(StopLocation stop) { return sortByOccurrenceAndReduce(getPatternModesOfStop(stop)).toList(); } @@ -716,7 +699,7 @@ public Deduplicator getDeduplicator() { } @Override - public Set getAllServiceCodes() { + public Set listServiceDates() { return Collections.unmodifiableSet( timetableRepositoryIndex.getServiceCodesRunningForDate().keySet() ); @@ -734,7 +717,7 @@ private Stream getPatternModesOfStop(StopLocation stop) { if (stop.getGtfsVehicleType() != null) { return Stream.of(stop.getGtfsVehicleType()); } else { - return getPatternsForStop(stop).stream().map(TripPattern::getMode); + return findPatterns(stop).stream().map(TripPattern::getMode); } } diff --git a/application/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java b/application/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java index 567cb245af5..411ab3d652b 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java @@ -1,6 +1,7 @@ package org.opentripplanner.transit.service; import java.time.LocalDate; +import javax.annotation.Nullable; import org.opentripplanner.model.FeedInfo; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitLayer; import org.opentripplanner.transit.model.basic.TransitMode; @@ -26,6 +27,12 @@ public interface TransitEditorService extends TransitService { FeedScopedId getOrCreateServiceIdForDate(LocalDate serviceDate); + /** + * Return the trip for the given id, not including trips created in real time. + */ + @Nullable + Trip getScheduledTrip(FeedScopedId id); + /** * Set the original, immutable, transit layer, * based on scheduled data (not real-time data). diff --git a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java index 7be2a29065a..d1c4159f63f 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java @@ -64,69 +64,65 @@ * copy-on-write and shares a lot of objects with any other TransitLayer instances. */ public interface TransitService { - Collection getFeedIds(); + Collection listFeedIds(); - Collection getAgencies(); - Optional findAgencyById(FeedScopedId id); + Collection listAgencies(); + Optional findAgency(FeedScopedId id); FeedInfo getFeedInfo(String feedId); - Collection getNoticesByEntity(AbstractTransitEntity entity); + Collection findNotices(AbstractTransitEntity entity); /** * Return a trip pattern by id, not including patterns created by real-time updates. */ - TripPattern getTripPatternForId(FeedScopedId id); + TripPattern getTripPattern(FeedScopedId id); /** * Return all scheduled trip patterns, not including real-time created trip patterns. * TODO: verify this is the intended behavior and possibly change the method name to * getAllScheduledTripPatterns */ - Collection getAllTripPatterns(); + Collection listTripPatterns(); - Collection getNotices(); - - Station getStationById(FeedScopedId id); + Station getStation(FeedScopedId id); MultiModalStation getMultiModalStation(FeedScopedId id); - Collection getStations(); + Collection listStations(); - Integer getServiceCodeForId(FeedScopedId id); + Integer getServiceCode(FeedScopedId id); TIntSet getServiceCodesRunningForDate(LocalDate date); - Agency getAgencyForId(FeedScopedId id); + Agency getAgency(FeedScopedId id); /** * Return a route for a given id, including routes created by real-time updates. * */ - Route getRouteForId(FeedScopedId id); + Route getRoute(FeedScopedId id); /** * Return the routes using the given stop, not including real-time updates. */ - Set getRoutesForStop(StopLocation stop); + Set findRoutes(StopLocation stop); /** * Return all the scheduled trip patterns for a specific stop * (not taking into account real-time updates). */ - Collection getPatternsForStop(StopLocation stop); + Collection findPatterns(StopLocation stop); /** * Returns all the patterns for a specific stop. If includeRealtimeUpdates is set, new patterns * added by realtime updates are added to the collection. */ - Collection getPatternsForStop(StopLocation stop, boolean includeRealtimeUpdates); - - Collection getTripsForStop(StopLocation stop); + Collection findPatterns(StopLocation stop, boolean includeRealtimeUpdates); - Collection getAllOperators(); + Collection listOperators(); - Operator getOperatorForId(FeedScopedId id); + Operator getOperator(FeedScopedId id); RegularStop getRegularStop(FeedScopedId id); @@ -144,56 +140,51 @@ public interface TransitService { * stop, area stop or stop group, then a list with one item is returned. * An empty list is if nothing is found. */ - Collection getStopOrChildStops(FeedScopedId id); + Collection findStopOrChildStops(FeedScopedId id); Collection listStopLocationGroups(); StopLocationsGroup getStopLocationsGroup(FeedScopedId id); + @Nullable AreaStop getAreaStop(FeedScopedId id); /** * Return the trip for the given id, including trips created in real time. */ @Nullable - Trip getTripForId(FeedScopedId id); - - /** - * Return the trip for the given id, not including trips created in real time. - */ - @Nullable - Trip getScheduledTripForId(FeedScopedId id); + Trip getTrip(FeedScopedId id); /** * Return all trips, including those created by real-time updates. */ - Collection getAllTrips(); + Collection listTrips(); /** * Return all routes, including those created by real-time updates. */ - Collection getAllRoutes(); + Collection listRoutes(); /** * Return the scheduled trip pattern for a given trip. * If the trip is an added trip (extra journey), return the initial trip pattern for this trip. */ - TripPattern getPatternForTrip(Trip trip); + TripPattern findPattern(Trip trip); /** * Return the trip pattern for a given trip on a service date. The real-time updated version * is returned if it exists, otherwise the scheduled trip pattern is returned. */ - TripPattern getPatternForTrip(Trip trip, LocalDate serviceDate); + TripPattern findPattern(Trip trip, LocalDate serviceDate); /** * Return all the trip patterns used in the given route, including those added by real-time updates */ - Collection getPatternsForRoute(Route route); + Collection findPatterns(Route route); - MultiModalStation getMultiModalStationForStation(Station station); + MultiModalStation findMultiModalStation(Station station); - List stopTimesForStop( + List findStopTimesInPattern( StopLocation stop, Instant startTime, Duration timeRange, @@ -202,14 +193,14 @@ List stopTimesForStop( boolean includeCancelledTrips ); - List getStopTimesForStop( + List findStopTimesInPattern( StopLocation stop, LocalDate serviceDate, ArrivalDeparture arrivalDeparture, boolean includeCancellations ); - List stopTimesForPatternAtStop( + List findTripTimeOnDate( StopLocation stop, TripPattern pattern, Instant startTime, @@ -219,18 +210,19 @@ List stopTimesForPatternAtStop( boolean includeCancellations ); - Collection getGroupsOfRoutes(); + Collection listGroupsOfRoutes(); - Collection getRoutesForGroupOfRoutes(GroupOfRoutes groupOfRoutes); + Collection findGroupsOfRoutes(GroupOfRoutes groupOfRoutes); - GroupOfRoutes getGroupOfRoutesForId(FeedScopedId id); + @Nullable + GroupOfRoutes getGroupOfRoutes(FeedScopedId id); /** * Return the timetable for a given trip pattern and date, taking into account real-time updates. * If no real-times update are applied, fall back to scheduled data. */ @Nullable - Timetable getTimetableForTripPattern(TripPattern tripPattern, LocalDate serviceDate); + Timetable findTimetable(TripPattern tripPattern, LocalDate serviceDate); /** * Return the real-time added pattern for a given tripId and a given service date. @@ -238,25 +230,25 @@ List stopTimesForPatternAtStop( * this date (that is: it is still using its scheduled trip pattern for this date). */ @Nullable - TripPattern getNewTripPatternForModifiedTrip(FeedScopedId tripId, LocalDate serviceDate); + TripPattern findNewTripPatternForModifiedTrip(FeedScopedId tripId, LocalDate serviceDate); /** * Return true if at least one trip pattern has been modified by a real-time update. */ boolean hasNewTripPatternsForModifiedTrips(); - TripOnServiceDate getTripOnServiceDateForTripAndDay(TripIdAndServiceDate tripIdAndServiceDate); + TripOnServiceDate findTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate); /** * Return the TripOnServiceDate for a given id, including real-time updates. */ - TripOnServiceDate getTripOnServiceDateById(FeedScopedId datedServiceJourneyId); + TripOnServiceDate findTripOnServiceDate(FeedScopedId datedServiceJourneyId); - Collection getAllTripOnServiceDates(); + Collection listTripsOnServiceDate(); - Set getTransitModes(); + Set listTransitModes(); - Collection getTransfersByStop(StopLocation stop); + Collection findPathTransfers(StopLocation stop); TransitLayer getTransitLayer(); @@ -293,7 +285,7 @@ List stopTimesForPatternAtStop( * The returning stream is ordered by the number of occurrences of the mode in the child stops. * So, if more patterns of mode BUS than RAIL visit the group, the result will be [BUS,RAIL]. */ - List getModesOfStopLocationsGroup(StopLocationsGroup station); + List findTransitModes(StopLocationsGroup station); /** * For a {@link StopLocation} return its modes. *

@@ -305,11 +297,11 @@ List stopTimesForPatternAtStop( *

* So, if more patterns of mode BUS than RAIL visit the stop, the result will be [BUS,RAIL]. */ - List getModesOfStopLocation(StopLocation stop); + List findTransitModes(StopLocation stop); Deduplicator getDeduplicator(); - Set getAllServiceCodes(); + Set listServiceDates(); Map getServiceCodesRunningForDate(); @@ -319,5 +311,5 @@ List stopTimesForPatternAtStop( * @param request - A TripOnServiceDateRequest object with filtering defined. * @return - A list of TripOnServiceDates */ - List getTripOnServiceDates(TripOnServiceDateRequest request); + List findTripsOnServiceDate(TripOnServiceDateRequest request); } diff --git a/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java b/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java index 96e2d25bbd8..1558910bd1b 100644 --- a/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java +++ b/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java @@ -55,7 +55,7 @@ public TripDescriptor match(String feedId, TripDescriptor trip) { } catch (ParseException e) { return trip; } - Route route = transitService.getRouteForId(routeId); + Route route = transitService.getRoute(routeId); if (route == null) { return trip; } @@ -85,7 +85,7 @@ public synchronized Trip getTrip( LocalDate date ) { TIntSet servicesRunningForDate = transitService.getServiceCodesRunningForDate(date); - for (TripPattern pattern : transitService.getPatternsForRoute(route)) { + for (TripPattern pattern : transitService.findPatterns(route)) { if (pattern.getDirection() != direction) continue; for (TripTimes times : pattern.getScheduledTimetable().getTripTimes()) { if ( diff --git a/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java b/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java index aff1659653b..d5f68c4d153 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java @@ -226,7 +226,7 @@ Result build() { // but in case of trip cancellation, OTP will fall back to scheduled trip times // therefore they must be valid tripTimes.validateNonIncreasingTimes(); - tripTimes.setServiceCode(transitService.getServiceCodeForId(trip.getServiceId())); + tripTimes.setServiceCode(transitService.getServiceCode(trip.getServiceId())); TripPattern pattern = TripPattern .of(getTripPatternId.apply(trip)) @@ -315,7 +315,7 @@ private Route createRoute(Agency agency) { @Nullable private Agency resolveAgency() { return transitService - .getAllRoutes() + .listRoutes() .stream() .filter(r -> r != null && r.getOperator() != null && r.getOperator().equals(operator)) .findFirst() diff --git a/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java b/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java index 1bce3e63974..d3b41588f31 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java @@ -54,7 +54,7 @@ public Trip resolveTrip(EstimatedVehicleJourney journey) { if (journey.getDatedVehicleJourneyRef() != null) { String datedServiceJourneyId = journey.getDatedVehicleJourneyRef().getValue(); - TripOnServiceDate tripOnServiceDate = transitService.getTripOnServiceDateById( + TripOnServiceDate tripOnServiceDate = transitService.findTripOnServiceDate( resolveId(datedServiceJourneyId) ); @@ -65,9 +65,7 @@ public Trip resolveTrip(EstimatedVehicleJourney journey) { // It is possible that the trip has previously been added, resolve the added trip if (journey.getEstimatedVehicleJourneyCode() != null) { - var addedTrip = transitService.getTripForId( - resolveId(journey.getEstimatedVehicleJourneyCode()) - ); + var addedTrip = transitService.getTrip(resolveId(journey.getEstimatedVehicleJourneyCode())); if (addedTrip != null) { return addedTrip; } @@ -115,13 +113,13 @@ public TripOnServiceDate resolveTripOnServiceDate( return null; } - return transitService.getTripOnServiceDateForTripAndDay( + return transitService.findTripOnServiceDate( new TripIdAndServiceDate(resolveId(serviceJourneyId), serviceDate) ); } public TripOnServiceDate resolveTripOnServiceDate(FeedScopedId datedServiceJourneyId) { - return transitService.getTripOnServiceDateById(datedServiceJourneyId); + return transitService.findTripOnServiceDate(datedServiceJourneyId); } public FeedScopedId resolveDatedServiceJourneyId( @@ -182,7 +180,7 @@ public Trip resolveTrip(FramedVehicleJourneyRefStructure journey) { } public Trip resolveTrip(String serviceJourneyId) { - return transitService.getTripForId(resolveId(serviceJourneyId)); + return transitService.getTrip(resolveId(serviceJourneyId)); } /** @@ -196,11 +194,11 @@ public RegularStop resolveQuay(String quayRef) { * Resolve a {@link Route} from a line id. */ public Route resolveRoute(String lineRef) { - return transitService.getRouteForId(resolveId(lineRef)); + return transitService.getRoute(resolveId(lineRef)); } public Operator resolveOperator(String operatorRef) { - return transitService.getOperatorForId(resolveId(operatorRef)); + return transitService.getOperator(resolveId(operatorRef)); } @Nullable @@ -246,7 +244,7 @@ private int calculateDayOffset(EstimatedVehicleJourney vehicleJourney) { if (trip == null) { return 0; } - var pattern = transitService.getPatternForTrip(trip); + var pattern = transitService.findPattern(trip); if (pattern == null) { return 0; } diff --git a/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java b/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java index 604dceed408..2cffc81b440 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java @@ -161,8 +161,8 @@ public List getTripIdForInternalPlanningCodeServiceDate( } private void initCache(TransitService index) { - for (Trip trip : index.getAllTrips()) { - TripPattern tripPattern = index.getPatternForTrip(trip); + for (Trip trip : index.listTrips()) { + TripPattern tripPattern = index.findPattern(trip); if (tripPattern == null) { continue; @@ -288,7 +288,7 @@ TripAndPattern getTripAndPatternForJourney( ); TripPattern tripPattern = newTripPatternForModifiedTrip != null ? newTripPatternForModifiedTrip - : transitService.getPatternForTrip(trip); + : transitService.findPattern(trip); var firstStop = tripPattern.firstStop(); var lastStop = tripPattern.lastStop(); diff --git a/application/src/main/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSource.java b/application/src/main/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSource.java index 33ca220ca7d..59fcede8374 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSource.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSource.java @@ -80,7 +80,7 @@ public SiriTimetableSnapshotSource( this.transitEditorService = new DefaultTransitService(timetableRepository, getTimetableSnapshotBuffer()); this.tripPatternCache = - new SiriTripPatternCache(tripPatternIdGenerator, transitEditorService::getPatternForTrip); + new SiriTripPatternCache(tripPatternIdGenerator, transitEditorService::findPattern); timetableRepository.initTimetableSnapshotProvider(this); } @@ -238,7 +238,7 @@ private Result handleModifiedTrip( if (trip != null) { // Found exact match - pattern = transitEditorService.getPatternForTrip(trip); + pattern = transitEditorService.findPattern(trip); } else if (fuzzyTripMatcher != null) { // No exact match found - search for trips based on arrival-times/stop-patterns TripAndPattern tripAndPattern = fuzzyTripMatcher.match( @@ -332,7 +332,7 @@ private Result addTripToGraphAndBuffer(TripUpdate tr private boolean markScheduledTripAsDeleted(Trip trip, final LocalDate serviceDate) { boolean success = false; - final TripPattern pattern = transitEditorService.getPatternForTrip(trip); + final TripPattern pattern = transitEditorService.findPattern(trip); if (pattern != null) { // Mark scheduled trip times for this trip in this pattern as deleted diff --git a/application/src/main/java/org/opentripplanner/updater/siri/mapper/AffectsMapper.java b/application/src/main/java/org/opentripplanner/updater/siri/mapper/AffectsMapper.java index a600f26c640..1f1c8c0b907 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/mapper/AffectsMapper.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/mapper/AffectsMapper.java @@ -375,7 +375,7 @@ private static FeedScopedId getStop( FeedScopedId id = new FeedScopedId(feedId, siriStopId); if (transitService.getRegularStop(id) != null) { return id; - } else if (transitService.getStationById(id) != null) { + } else if (transitService.getStation(id) != null) { return id; } diff --git a/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java b/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java index 54c3901f3e8..929f60b99f0 100644 --- a/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java +++ b/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java @@ -387,7 +387,7 @@ private Result handleScheduledTrip( return UpdateError.result(tripId, NO_UPDATES); } - final FeedScopedId serviceId = transitEditorService.getTripForId(tripId).getServiceId(); + final FeedScopedId serviceId = transitEditorService.getTrip(tripId).getServiceId(); final Set serviceDates = transitEditorService .getCalendarService() .getServiceDatesForServiceId(serviceId); @@ -431,7 +431,7 @@ private Result handleScheduledTrip( .cancelStops(skippedStopIndices) .build(); - final Trip trip = transitEditorService.getTripForId(tripId); + final Trip trip = transitEditorService.getTrip(tripId); // Get cached trip pattern or create one if it doesn't exist yet final TripPattern newPattern = tripPatternCache.getOrCreateTripPattern( newStopPattern, @@ -473,7 +473,7 @@ private Result validateAndHandleAddedTrip( // // Check whether trip id already exists in graph - final Trip trip = transitEditorService.getScheduledTripForId(tripId); + final Trip trip = transitEditorService.getScheduledTrip(tripId); if (trip != null) { // TODO: should we support this and add a new instantiation of this trip (making it @@ -653,7 +653,7 @@ private Result handleAddedTrip( boolean routeExists = routeExists(tripId.getFeedId(), tripDescriptor); if (routeExists) { route = - transitEditorService.getRouteForId( + transitEditorService.getRoute( new FeedScopedId(tripId.getFeedId(), tripDescriptor.getRouteId()) ); } else { @@ -706,7 +706,7 @@ private Route createRoute(TripDescriptor tripDescriptor, FeedScopedId tripId) { var addedRouteExtension = AddedRoute.ofTripDescriptor(tripDescriptor); var agency = transitEditorService - .findAgencyById(new FeedScopedId(tripId.getFeedId(), addedRouteExtension.agencyId())) + .findAgency(new FeedScopedId(tripId.getFeedId(), addedRouteExtension.agencyId())) .orElseGet(() -> fallbackAgency(tripId.getFeedId())); builder.withAgency(agency); @@ -751,7 +751,7 @@ private Agency fallbackAgency(String feedId) { private boolean routeExists(String feedId, TripDescriptor tripDescriptor) { if (tripDescriptor.hasRouteId() && StringUtils.hasValue(tripDescriptor.getRouteId())) { var routeId = new FeedScopedId(feedId, tripDescriptor.getRouteId()); - return Objects.nonNull(transitEditorService.getRouteForId(routeId)); + return Objects.nonNull(transitEditorService.getRoute(routeId)); } else { return false; } @@ -841,7 +841,7 @@ private Result addTripToGraphAndBuffer( // Create StopPattern final StopPattern stopPattern = new StopPattern(stopTimes); - final TripPattern originalTripPattern = transitEditorService.getPatternForTrip(trip); + final TripPattern originalTripPattern = transitEditorService.findPattern(trip); // Get cached trip pattern or create one if it doesn't exist yet final TripPattern pattern = tripPatternCache.getOrCreateTripPattern( stopPattern, @@ -1000,7 +1000,7 @@ private Result validateAndHandleModifiedTrip( // // Check whether trip id already exists in graph - Trip trip = transitEditorService.getTripForId(tripId); + Trip trip = transitEditorService.getTrip(tripId); if (trip == null) { // TODO: should we support this and consider it an ADDED trip? @@ -1117,8 +1117,8 @@ private Result handleCanceledTrip( * @return trip pattern or null if no trip pattern was found */ private TripPattern getPatternForTripId(FeedScopedId tripId) { - Trip trip = transitEditorService.getTripForId(tripId); - return transitEditorService.getPatternForTrip(trip); + Trip trip = transitEditorService.getTrip(tripId); + return transitEditorService.findPattern(trip); } private static void debug(FeedScopedId id, String message, Object... params) { diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_position/VehiclePositionUpdaterRunnable.java b/application/src/main/java/org/opentripplanner/updater/vehicle_position/VehiclePositionUpdaterRunnable.java index 3165221a5fc..9ab2915f566 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_position/VehiclePositionUpdaterRunnable.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_position/VehiclePositionUpdaterRunnable.java @@ -35,9 +35,9 @@ public VehiclePositionUpdaterRunnable( public void run(RealTimeUpdateContext context) { RealtimeVehiclePatternMatcher matcher = new RealtimeVehiclePatternMatcher( feedId, - context.transitService()::getTripForId, - context.transitService()::getPatternForTrip, - context.transitService()::getPatternForTrip, + context.transitService()::getTrip, + context.transitService()::findPattern, + context.transitService()::findPattern, realtimeVehicleRepository, context.transitService().getTimeZone(), fuzzyTripMatching ? context.gtfsRealtimeFuzzyTripMatcher() : null, diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 5d79c24d05f..f637d2f9f54 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -210,7 +210,7 @@ static void setup() { ); @Override - public List getModesOfStopLocation(StopLocation stop) { + public List findTransitModes(StopLocation stop) { return List.of(BUS, FERRY); } @@ -220,7 +220,7 @@ public TransitAlertService getTransitAlertService() { } @Override - public Set getRoutesForStop(StopLocation stop) { + public Set findRoutes(StopLocation stop) { return Set.of(ROUTE); } }; diff --git a/application/src/test/java/org/opentripplanner/model/impl/OtpTransitServiceImplTest.java b/application/src/test/java/org/opentripplanner/model/impl/OtpTransitServiceImplTest.java index 728208438a8..4b7636ca07f 100644 --- a/application/src/test/java/org/opentripplanner/model/impl/OtpTransitServiceImplTest.java +++ b/application/src/test/java/org/opentripplanner/model/impl/OtpTransitServiceImplTest.java @@ -123,7 +123,7 @@ public void testGetAllStopTimes() { } @Test - public void testGetAllTrips() { + public void testListTrips() { Collection trips = subject.getAllTrips(); assertEquals(34, trips.size()); diff --git a/application/src/test/java/org/opentripplanner/routing/graph/DefaultRoutingServiceTest.java b/application/src/test/java/org/opentripplanner/routing/graph/DefaultRoutingServiceTest.java index a019a7059e5..ab897e3410b 100644 --- a/application/src/test/java/org/opentripplanner/routing/graph/DefaultRoutingServiceTest.java +++ b/application/src/test/java/org/opentripplanner/routing/graph/DefaultRoutingServiceTest.java @@ -56,11 +56,11 @@ public void testIdLookup() { } /* Agencies */ - String feedId = transitService.getFeedIds().iterator().next(); + String feedId = transitService.listFeedIds().iterator().next(); Agency agency; - agency = transitService.getAgencyForId(new FeedScopedId(feedId, "azerty")); + agency = transitService.getAgency(new FeedScopedId(feedId, "azerty")); assertNull(agency); - agency = transitService.getAgencyForId(new FeedScopedId(feedId, "agency")); + agency = transitService.getAgency(new FeedScopedId(feedId, "agency")); assertEquals(feedId + ":" + "agency", agency.getId().toString()); assertEquals("Fake Agency", agency.getName()); @@ -79,18 +79,18 @@ public void testIdLookup() { */ @Test public void testPatternsCoherent() { - for (Trip trip : transitService.getAllTrips()) { - TripPattern pattern = transitService.getPatternForTrip(trip); + for (Trip trip : transitService.listTrips()) { + TripPattern pattern = transitService.findPattern(trip); assertTrue(pattern.scheduledTripsAsStream().anyMatch(t -> t.equals(trip))); } /* This one depends on a feed where each TripPattern appears on only one route. */ - for (Route route : transitService.getAllRoutes()) { - for (TripPattern pattern : transitService.getPatternsForRoute(route)) { + for (Route route : transitService.listRoutes()) { + for (TripPattern pattern : transitService.findPatterns(route)) { assertEquals(pattern.getRoute(), route); } } for (var stop : transitService.listStopLocations()) { - for (TripPattern pattern : transitService.getPatternsForStop(stop)) { + for (TripPattern pattern : transitService.findPatterns(stop)) { int stopPos = pattern.findStopPosition(stop); assertTrue(stopPos >= 0, "Stop position exist"); } @@ -99,7 +99,7 @@ public void testPatternsCoherent() { @Test public void testSpatialIndex() { - String feedId = transitService.getFeedIds().iterator().next(); + String feedId = transitService.listFeedIds().iterator().next(); FeedScopedId idJ = new FeedScopedId(feedId, "J"); var stopJ = transitService.getRegularStop(idJ); FeedScopedId idL = new FeedScopedId(feedId, "L"); diff --git a/application/src/test/java/org/opentripplanner/routing/stoptimes/StopTimesHelperTest.java b/application/src/test/java/org/opentripplanner/routing/stoptimes/StopTimesHelperTest.java index b5b4d471e53..52ddaf86d91 100644 --- a/application/src/test/java/org/opentripplanner/routing/stoptimes/StopTimesHelperTest.java +++ b/application/src/test/java/org/opentripplanner/routing/stoptimes/StopTimesHelperTest.java @@ -33,8 +33,8 @@ public static void setUp() throws Exception { transitService = new DefaultTransitService(timetableRepository); feedId = timetableRepository.getFeedIds().iterator().next(); stopId = new FeedScopedId(feedId, "J"); - var originalPattern = transitService.getPatternForTrip( - transitService.getTripForId(new FeedScopedId(feedId, "5.1")) + var originalPattern = transitService.findPattern( + transitService.getTrip(new FeedScopedId(feedId, "5.1")) ); var tt = originalPattern.getScheduledTimetable(); var newTripTimes = tt.getTripTimes(0).copyScheduledTimes(); diff --git a/application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java b/application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java index 1c0d2a03a0f..efc4fa2c9e2 100644 --- a/application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java +++ b/application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java @@ -82,7 +82,7 @@ static void setup() { service = new DefaultTransitService(timetableRepository) { @Override - public Collection getPatternsForStop(StopLocation stop) { + public Collection findPatterns(StopLocation stop) { if (stop.equals(STOP_B)) { return List.of(FERRY_PATTERN, FERRY_PATTERN, RAIL_PATTERN, RAIL_PATTERN, RAIL_PATTERN); } else { @@ -94,31 +94,31 @@ public Collection getPatternsForStop(StopLocation stop) { @Test void modeFromGtfsVehicleType() { - var modes = service.getModesOfStopLocation(STOP_A); + var modes = service.findTransitModes(STOP_A); assertEquals(List.of(TRAM), modes); } @Test void modeFromPatterns() { - var modes = service.getModesOfStopLocation(STOP_B); + var modes = service.findTransitModes(STOP_B); assertEquals(List.of(RAIL, FERRY), modes); } @Test void stationModes() { - var modes = service.getModesOfStopLocationsGroup(STATION); + var modes = service.findTransitModes(STATION); assertEquals(List.of(RAIL, FERRY, TRAM), modes); } @Test void getPatternForStopsWithoutRealTime() { - Collection patternsForStop = service.getPatternsForStop(STOP_B, false); + Collection patternsForStop = service.findPatterns(STOP_B, false); assertEquals(Set.of(FERRY_PATTERN, RAIL_PATTERN), patternsForStop); } @Test void getPatternForStopsWithRealTime() { - Collection patternsForStop = service.getPatternsForStop(STOP_B, true); + Collection patternsForStop = service.findPatterns(STOP_B, true); assertEquals(Set.of(FERRY_PATTERN, RAIL_PATTERN, REAL_TIME_PATTERN), patternsForStop); } } diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index f0e87b046c5..42fd39089b6 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -336,8 +336,8 @@ private void saveTestCasesToResultFile() { private void updateTimersWithGlobalCounters() { final var transitService = serverContext.transitService(); timer.globalCount("transitdata_stops", transitService.listStopLocations().size()); - timer.globalCount("transitdata_patterns", transitService.getAllTripPatterns().size()); - timer.globalCount("transitdata_trips", transitService.getAllTrips().size()); + timer.globalCount("transitdata_patterns", transitService.listTripPatterns().size()); + timer.globalCount("transitdata_trips", transitService.listTrips().size()); // we want to get the numbers after the garbage collection forceGCToAvoidGCLater(); diff --git a/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java b/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java index 901842adb45..5bf700cc04a 100644 --- a/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java +++ b/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java @@ -56,7 +56,7 @@ void testAddJourneyWithExistingRoute() { var env = RealtimeTestEnvironment.siri().addTrip(TRIP_1_INPUT).build(); Route route = ROUTE_1; - int numPatternForRoute = env.getTransitService().getPatternsForRoute(route).size(); + int numPatternForRoute = env.getTransitService().findPatterns(route).size(); String newJourneyId = "newJourney"; var updates = createValidAddedJourney(env).buildEstimatedTimetableDeliveries(); @@ -71,18 +71,16 @@ void testAddJourneyWithExistingRoute() { ); FeedScopedId tripId = id(newJourneyId); TransitService transitService = env.getTransitService(); - Trip trip = transitService.getTripForId(tripId); + Trip trip = transitService.getTrip(tripId); assertNotNull(trip); - assertNotNull(transitService.getPatternForTrip(trip)); - assertNotNull(transitService.getTripOnServiceDateById(tripId)); + assertNotNull(transitService.findPattern(trip)); + assertNotNull(transitService.findTripOnServiceDate(tripId)); assertNotNull( - transitService.getTripOnServiceDateForTripAndDay( - new TripIdAndServiceDate(tripId, SERVICE_DATE) - ) + transitService.findTripOnServiceDate(new TripIdAndServiceDate(tripId, SERVICE_DATE)) ); assertEquals( numPatternForRoute + 1, - transitService.getPatternsForRoute(route).size(), + transitService.findPatterns(route).size(), "The added trip should use a new pattern for this route" ); } @@ -97,7 +95,7 @@ void testAddJourneyWithNewRoute() { .withLineRef(newRouteRef) .buildEstimatedTimetableDeliveries(); - int numRoutes = env.getTransitService().getAllRoutes().size(); + int numRoutes = env.getTransitService().listRoutes().size(); var result = env.applyEstimatedTimetable(updates); assertEquals(1, result.successful()); @@ -107,11 +105,11 @@ void testAddJourneyWithNewRoute() { env.getScheduledTimetable("newJourney") ); TransitService transitService = env.getTransitService(); - assertEquals(numRoutes + 1, transitService.getAllRoutes().size()); + assertEquals(numRoutes + 1, transitService.listRoutes().size()); FeedScopedId newRouteId = id(newRouteRef); - Route newRoute = transitService.getRouteForId(newRouteId); + Route newRoute = transitService.getRoute(newRouteId); assertNotNull(newRoute); - assertEquals(1, transitService.getPatternsForRoute(newRoute).size()); + assertEquals(1, transitService.findPatterns(newRoute).size()); } @Test @@ -120,13 +118,13 @@ void testAddJourneyMultipleTimes() { var env = RealtimeTestEnvironment.siri().addTrip(TRIP_1_INPUT).build(); var updates = createValidAddedJourney(env).buildEstimatedTimetableDeliveries(); - int numTrips = env.getTransitService().getAllTrips().size(); + int numTrips = env.getTransitService().listTrips().size(); var result1 = env.applyEstimatedTimetable(updates); assertEquals(1, result1.successful()); - assertEquals(numTrips + 1, env.getTransitService().getAllTrips().size()); + assertEquals(numTrips + 1, env.getTransitService().listTrips().size()); var result2 = env.applyEstimatedTimetable(updates); assertEquals(1, result2.successful()); - assertEquals(numTrips + 1, env.getTransitService().getAllTrips().size()); + assertEquals(numTrips + 1, env.getTransitService().listTrips().size()); } @Test diff --git a/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java b/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java index 8231d8868f1..f892327eb81 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java @@ -96,9 +96,9 @@ public TransitService getTransitService() { */ public TripTimes getTripTimesForTrip(FeedScopedId tripId, LocalDate serviceDate) { var transitService = getTransitService(); - var trip = transitService.getTripOnServiceDateById(tripId).getTrip(); - var pattern = transitService.getPatternForTrip(trip, serviceDate); - var timetable = transitService.getTimetableForTripPattern(pattern, serviceDate); + var trip = transitService.findTripOnServiceDate(tripId).getTrip(); + var pattern = transitService.findPattern(trip, serviceDate); + var timetable = transitService.findTimetable(pattern, serviceDate); return timetable.getTripTimes(trip); } @@ -120,8 +120,8 @@ public TripPattern getPatternForTrip(String id) { public TripPattern getPatternForTrip(FeedScopedId tripId, LocalDate serviceDate) { var transitService = getTransitService(); - var trip = transitService.getTripOnServiceDateById(tripId); - return transitService.getPatternForTrip(trip.getTrip(), serviceDate); + var trip = transitService.findTripOnServiceDate(tripId); + return transitService.findPattern(trip.getTrip(), serviceDate); } /** diff --git a/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java b/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java index 8e3c793666a..d0e6f19a156 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java @@ -61,7 +61,7 @@ public void setUp() { timetableRepository = model.timetableRepository(); transitService = new DefaultTransitService(timetableRepository); - feedId = transitService.getFeedIds().stream().findFirst().get(); + feedId = transitService.listFeedIds().stream().findFirst().get(); } @Test @@ -206,8 +206,8 @@ public void testHandleModifiedTrip() { // Original trip pattern { final FeedScopedId tripId = new FeedScopedId(feedId, modifiedTripId); - final Trip trip = transitService.getTripForId(tripId); - final TripPattern originalTripPattern = transitService.getPatternForTrip(trip); + final Trip trip = transitService.getTrip(tripId); + final TripPattern originalTripPattern = transitService.findPattern(trip); final Timetable originalTimetableForToday = snapshot.resolve( originalTripPattern, diff --git a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/addition/AddedTest.java b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/addition/AddedTest.java index 3a3d7d5e130..e926361f4ea 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/addition/AddedTest.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/addition/AddedTest.java @@ -63,9 +63,9 @@ void addedTripWithNewRoute() { assertEquals(TransitMode.RAIL, route.getMode()); TransitService transitService = env.getTransitService(); - var fromTimetableRepository = transitService.getRouteForId(route.getId()); + var fromTimetableRepository = transitService.getRoute(route.getId()); assertEquals(fromTimetableRepository, route); - var patternsForRoute = transitService.getPatternsForRoute(route); + var patternsForRoute = transitService.findPatterns(route); assertEquals(1, patternsForRoute.size()); assertEquals(pattern, patternsForRoute.stream().findFirst().orElseThrow()); @@ -121,16 +121,16 @@ void repeatedlyAddedTripWithNewRoute() { var secondRoute = secondPattern.getRoute(); assertSame(firstRoute, secondRoute); - assertNotNull(env.getTransitService().getRouteForId(firstRoute.getId())); + assertNotNull(env.getTransitService().getRoute(firstRoute.getId())); } private TripPattern assertAddedTrip(String tripId, RealtimeTestEnvironment env) { var snapshot = env.getTimetableSnapshot(); TransitService transitService = env.getTransitService(); - Trip trip = transitService.getTripForId(TimetableRepositoryForTest.id(ADDED_TRIP_ID)); + Trip trip = transitService.getTrip(TimetableRepositoryForTest.id(ADDED_TRIP_ID)); assertNotNull(trip); - assertNotNull(transitService.getPatternForTrip(trip)); + assertNotNull(transitService.findPattern(trip)); var stopA = env.timetableRepository.getSiteRepository().getRegularStop(STOP_A1.getId()); // Get the trip pattern of the added trip which goes through stopA diff --git a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/DelayedTest.java b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/DelayedTest.java index 8231e21bce7..665c79d193c 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/DelayedTest.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/DelayedTest.java @@ -90,8 +90,8 @@ void complexDelay() { var snapshot = env.getTimetableSnapshot(); - var trip2 = env.getTransitService().getTripForId(id(TRIP_2_ID)); - var originalTripPattern = env.getTransitService().getPatternForTrip(trip2); + var trip2 = env.getTransitService().getTrip(id(TRIP_2_ID)); + var originalTripPattern = env.getTransitService().findPattern(trip2); var originalTimetableForToday = snapshot.resolve(originalTripPattern, SERVICE_DATE); var originalTimetableScheduled = snapshot.resolve(originalTripPattern, null); diff --git a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java index c4b4c9e9bbd..e10b86797b8 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java @@ -133,8 +133,8 @@ private static void assertOriginalTripPatternIsDeleted( RealtimeTestEnvironment env, String tripId ) { - var trip = env.getTransitService().getTripForId(id(tripId)); - var originalTripPattern = env.getTransitService().getPatternForTrip(trip); + var trip = env.getTransitService().getTrip(id(tripId)); + var originalTripPattern = env.getTransitService().findPattern(trip); var snapshot = env.getTimetableSnapshot(); var originalTimetableForToday = snapshot.resolve(originalTripPattern, SERVICE_DATE); var originalTimetableScheduled = snapshot.resolve(originalTripPattern, null); @@ -176,8 +176,8 @@ private static void assertOriginalTripPatternIsDeleted( } private static void assertNewTripTimesIsUpdated(RealtimeTestEnvironment env, String tripId) { - var trip = env.getTransitService().getTripForId(id(tripId)); - var originalTripPattern = env.getTransitService().getPatternForTrip(trip); + var trip = env.getTransitService().getTrip(id(tripId)); + var originalTripPattern = env.getTransitService().findPattern(trip); var snapshot = env.getTimetableSnapshot(); var originalTimetableForToday = snapshot.resolve(originalTripPattern, SERVICE_DATE); From 6075162552c219e4f7ae95e71f634b1260e8d122 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 19 Nov 2024 10:09:07 +0100 Subject: [PATCH 17/55] Fix formatting --- .../module/nearbystops/PatternConsideringNearbyStopFinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java b/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java index 3804e7f65d8..8df2a25b64e 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/nearbystops/PatternConsideringNearbyStopFinder.java @@ -1,7 +1,7 @@ package org.opentripplanner.graph_builder.module.nearbystops; -import java.util.HashSet; import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Set; import org.opentripplanner.ext.flex.trip.FlexTrip; From dd363aab68cacb173a5ada49a4bd888c19af329b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 20 Nov 2024 11:56:00 +0100 Subject: [PATCH 18/55] Apply review feedback about collection types --- .../parkAndRideApi/ParkAndRideResource.java | 3 +- .../ext/restapi/model/ApiRouterInfo.java | 6 +-- .../VehicleParkingGroupsLayerBuilder.java | 2 +- .../VehicleParkingsLayerBuilder.java | 2 +- .../apis/gtfs/datafetchers/QueryTypeImpl.java | 30 +++++++++----- .../transmodel/TransmodelGraphQLSchema.java | 6 ++- .../VehicleParkingRepository.java | 3 +- .../vehicleparking/VehicleParkingService.java | 12 +++--- .../DefaultVehicleParkingRepository.java | 5 +-- .../DefaultVehicleParkingService.java | 28 ++++++++----- .../VehicleParkingAvailabilityUpdater.java | 3 +- .../module/VehicleParkingLinkingTest.java | 2 +- .../module/osm/OsmModuleTest.java | 6 +-- ...VehicleParkingAvailabilityUpdaterTest.java | 6 +-- .../VehicleParkingUpdaterTest.java | 40 +++++++++---------- 15 files changed, 84 insertions(+), 70 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java index cf86f803aba..747ba0617ec 100644 --- a/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/parkAndRideApi/ParkAndRideResource.java @@ -73,7 +73,8 @@ public Response getParkAndRide( } var prs = vehicleParkingService - .getCarParks() + .listCarParks() + .stream() .filter(lot -> envelope.contains(lot.getCoordinate().asJtsCoordinate())) .filter(lot -> hasTransitStopsNearby(maxTransitDistance, lot)) .map(ParkAndRideInfo::ofVehicleParking) diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java index ba5dd39ea59..4ebce8c33d6 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiRouterInfo.java @@ -66,21 +66,21 @@ public boolean mapHasBikePark(VehicleParkingService service) { if (service == null) { return false; } - return service.getBikeParks().findAny().isPresent(); + return service.listBikeParks().stream().findAny().isPresent(); } public boolean mapHasCarPark(VehicleParkingService service) { if (service == null) { return false; } - return service.getCarParks().findAny().isPresent(); + return service.listCarParks().stream().findAny().isPresent(); } public boolean mapHasVehicleParking(VehicleParkingService service) { if (service == null) { return false; } - return service.getVehicleParkings().findAny().isPresent(); + return service.listVehicleParkings().stream().findAny().isPresent(); } public double getLowerLeftLatitude() { diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java index 6df19d61a8a..36217e05972 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingGroupsLayerBuilder.java @@ -39,7 +39,7 @@ public VehicleParkingGroupsLayerBuilder( @Override protected List getGeometries(Envelope query) { return service - .getVehicleParkingGroups() + .listVehicleParkingGroups() .asMap() .entrySet() .stream() diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java index 40d9c97e4d7..22fb75f7b49 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/VehicleParkingsLayerBuilder.java @@ -46,7 +46,7 @@ public VehicleParkingsLayerBuilder( @Override protected List getGeometries(Envelope query) { return service - .getVehicleParkings() + .listVehicleParkings().stream() .map(vehicleParking -> { Coordinate coordinate = vehicleParking.getCoordinate().asJtsCoordinate(); Point point = GeometryUtils.getGeometryFactory().createPoint(coordinate); diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java index 4f1400ab110..49d04f98076 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java @@ -123,7 +123,8 @@ public DataFetcher bikePark() { .vehicleParkingService(); return vehicleParkingService - .getBikeParks() + .listBikeParks() + .stream() .filter(bikePark -> bikePark.getId().getId().equals(args.getGraphQLId())) .findAny() .orElse(null); @@ -137,7 +138,7 @@ public DataFetcher> bikeParks() { .getContext() .vehicleParkingService(); - return vehicleParkingService.getBikeParks().toList(); + return vehicleParkingService.listBikeParks().stream().toList(); }; } @@ -210,7 +211,8 @@ public DataFetcher carPark() { .vehicleParkingService(); return vehicleParkingService - .getCarParks() + .listCarParks() + .stream() .filter(carPark -> carPark.getId().getId().equals(args.getGraphQLId())) .findAny() .orElse(null); @@ -231,14 +233,15 @@ public DataFetcher> carParks() { if (!idList.isEmpty()) { Map carParkMap = vehicleParkingService - .getCarParks() + .listCarParks() + .stream() .collect(Collectors.toMap(station -> station.getId().getId(), station -> station)); return idList.stream().map(carParkMap::get).toList(); } } - return vehicleParkingService.getCarParks().toList(); + return vehicleParkingService.listCarParks(); }; } @@ -400,7 +403,8 @@ public DataFetcher node() { return vehicleParkingService == null ? null : vehicleParkingService - .getBikeParks() + .listBikeParks() + .stream() .filter(bikePark -> bikePark.getId().equals(bikeParkId)) .findAny() .orElse(null); @@ -421,7 +425,8 @@ public DataFetcher node() { return vehicleParkingService == null ? null : vehicleParkingService - .getCarParks() + .listCarParks() + .stream() .filter(carPark -> carPark.getId().equals(carParkId)) .findAny() .orElse(null); @@ -472,7 +477,8 @@ public DataFetcher node() { return vehicleParkingService == null ? null : vehicleParkingService - .getVehicleParkings() + .listVehicleParkings() + .stream() .filter(bikePark -> bikePark.getId().equals(vehicleParkingId)) .findAny() .orElse(null); @@ -836,7 +842,8 @@ public DataFetcher vehicleParking() { var vehicleParkingId = FeedScopedId.parse(args.getGraphQLId()); return vehicleParkingService - .getVehicleParkings() + .listVehicleParkings() + .stream() .filter(vehicleParking -> vehicleParking.getId().equals(vehicleParkingId)) .findAny() .orElse(null); @@ -857,14 +864,15 @@ public DataFetcher> vehicleParkings() { if (!idList.isEmpty()) { Map vehicleParkingMap = vehicleParkingService - .getVehicleParkings() + .listVehicleParkings() + .stream() .collect(Collectors.toMap(station -> station.getId().toString(), station -> station)); return idList.stream().map(vehicleParkingMap::get).toList(); } } - return vehicleParkingService.getVehicleParkings().toList(); + return vehicleParkingService.listVehicleParkings(); }; } diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java index 2ffb9941bc6..33fd2b9a72f 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java @@ -1450,7 +1450,8 @@ private GraphQLSchema create() { var bikeParkId = TransitIdMapper.mapIDToDomain(environment.getArgument("id")); return GqlUtil .getVehicleParkingService(environment) - .getBikeParks() + .listBikeParks() + .stream() .filter(bikePark -> bikePark.getId().equals(bikeParkId)) .findFirst() .orElse(null); @@ -1467,7 +1468,8 @@ private GraphQLSchema create() { .dataFetcher(environment -> GqlUtil .getVehicleParkingService(environment) - .getBikeParks() + .listBikeParks() + .stream() .collect(Collectors.toCollection(ArrayList::new)) ) .build() diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java index cdb6f195f10..ae4094d904e 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java @@ -2,7 +2,6 @@ import com.google.common.collect.ImmutableListMultimap; import java.util.Collection; -import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -14,7 +13,7 @@ void updateVehicleParking( Collection parkingToAdd, Collection parkingToRemove ); - Stream getVehicleParkings(); + Collection listVehicleParkings(); ImmutableListMultimap getVehicleParkingGroups(); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java index 3ca13165a05..4603367979e 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingService.java @@ -1,7 +1,7 @@ package org.opentripplanner.service.vehicleparking; -import com.google.common.collect.ImmutableListMultimap; -import java.util.stream.Stream; +import com.google.common.collect.ListMultimap; +import java.util.Collection; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -11,13 +11,13 @@ * For writing data see {@link VehicleParkingRepository} */ public interface VehicleParkingService { - Stream getBikeParks(); + Collection listBikeParks(); - Stream getCarParks(); + Collection listCarParks(); - Stream getVehicleParkings(); + Collection listVehicleParkings(); - ImmutableListMultimap getVehicleParkingGroups(); + ListMultimap listVehicleParkingGroups(); boolean hasBikeParking(); diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java index 660b539052e..e0714e74ee8 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java @@ -8,7 +8,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import java.util.stream.Stream; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -67,8 +66,8 @@ public void updateVehicleParking( } @Override - public Stream getVehicleParkings() { - return vehicleParkings.stream(); + public Collection listVehicleParkings() { + return Set.copyOf(vehicleParkings); } @Override diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java index 04ff1558347..cb4f6680b82 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -4,7 +4,7 @@ import jakarta.inject.Inject; import jakarta.inject.Singleton; import java.io.Serializable; -import java.util.stream.Stream; +import java.util.Collection; import org.opentripplanner.service.vehicleparking.VehicleParkingRepository; import org.opentripplanner.service.vehicleparking.VehicleParkingService; import org.opentripplanner.service.vehicleparking.model.VehicleParking; @@ -29,32 +29,40 @@ public DefaultVehicleParkingService(VehicleParkingRepository repository) { } @Override - public Stream getBikeParks() { - return repository.getVehicleParkings().filter(VehicleParking::hasBicyclePlaces); + public Collection listBikeParks() { + return repository + .listVehicleParkings() + .stream() + .filter(VehicleParking::hasBicyclePlaces) + .toList(); } @Override - public Stream getCarParks() { - return repository.getVehicleParkings().filter(VehicleParking::hasAnyCarPlaces); + public Collection listCarParks() { + return repository + .listVehicleParkings() + .stream() + .filter(VehicleParking::hasAnyCarPlaces) + .toList(); } @Override - public Stream getVehicleParkings() { - return repository.getVehicleParkings(); + public Collection listVehicleParkings() { + return repository.listVehicleParkings(); } @Override - public ImmutableListMultimap getVehicleParkingGroups() { + public ImmutableListMultimap listVehicleParkingGroups() { return repository.getVehicleParkingGroups(); } @Override public boolean hasBikeParking() { - return repository.getVehicleParkings().anyMatch(VehicleParking::hasBicyclePlaces); + return repository.listVehicleParkings().stream().anyMatch(VehicleParking::hasBicyclePlaces); } @Override public boolean hasCarParking() { - return repository.getVehicleParkings().anyMatch(VehicleParking::hasAnyCarPlaces); + return repository.listVehicleParkings().stream().anyMatch(VehicleParking::hasAnyCarPlaces); } } diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java index c4de4de23a1..e548d5d75be 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java @@ -67,7 +67,8 @@ private AvailabilityUpdater(List updates) { this.updates = List.copyOf(updates); this.parkingById = repository - .getVehicleParkings() + .listVehicleParkings() + .stream() .collect(Collectors.toUnmodifiableMap(VehicleParking::getId, Function.identity())); } diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java index 02795b45042..4f0a20bfb7f 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/VehicleParkingLinkingTest.java @@ -184,6 +184,6 @@ public void removeVehicleParkingWithOneEntranceAndNonExistingVertexTest() { assertEquals(0, graph.getEdgesOfType(StreetVehicleParkingLink.class).size()); assertEquals(0, graph.getEdgesOfType(StreetVehicleParkingLink.class).size()); - assertEquals(0, vehicleParkingService.getVehicleParkings().count()); + assertEquals(0, vehicleParkingService.listVehicleParkings().size()); } } diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 3c391a57246..833b14ade9d 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -286,9 +286,9 @@ public void testLocalizedString() { void addParkingLotsToService() { var service = new DefaultVehicleParkingService(buildParkingLots().repository); - assertEquals(11, service.getVehicleParkings().count()); - assertEquals(6, service.getBikeParks().count()); - assertEquals(5, service.getCarParks().count()); + assertEquals(11, service.listVehicleParkings().size()); + assertEquals(6, service.listBikeParks().size()); + assertEquals(5, service.listCarParks().size()); } @Test diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java index 26e8403abe9..ecf7904de4a 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdaterTest.java @@ -56,7 +56,7 @@ void updateCarAvailability() { runUpdaterOnce(updater); - var updated = service.getVehicleParkings().toList().getFirst(); + var updated = List.copyOf(service.listVehicleParkings()).getFirst(); assertEquals(ID, updated.getId()); assertEquals(8, updated.getAvailability().getCarSpaces()); assertNull(updated.getAvailability().getBicycleSpaces()); @@ -73,7 +73,7 @@ void updateBicycleAvailability() { runUpdaterOnce(updater); - var updated = service.getVehicleParkings().toList().getFirst(); + var updated = List.copyOf(service.listVehicleParkings()).getFirst(); assertEquals(ID, updated.getId()); assertEquals(8, updated.getAvailability().getBicycleSpaces()); assertNull(updated.getAvailability().getCarSpaces()); @@ -90,7 +90,7 @@ void notFound() { runUpdaterOnce(updater); - var updated = service.getVehicleParkings().toList().getFirst(); + var updated = List.copyOf(service.listVehicleParkings()).getFirst(); assertEquals(ID, updated.getId()); assertNull(updated.getAvailability()); } diff --git a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java index dbabc3dd89c..261cd55011d 100644 --- a/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java +++ b/application/src/test/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdaterTest.java @@ -33,7 +33,6 @@ class VehicleParkingUpdaterTest { private DataSource dataSource; private Graph graph; - private TimetableRepository timetableRepository; private DefaultRealTimeUpdateContext realTimeUpdateContext; private VehicleParkingUpdater vehicleParkingUpdater; @@ -45,7 +44,7 @@ public void setup() { VehicleParkingTestGraphData graphData = new VehicleParkingTestGraphData(); graphData.initGraph(); graph = graphData.getGraph(); - timetableRepository = graphData.getTimetableRepository(); + TimetableRepository timetableRepository = graphData.getTimetableRepository(); parkingRepository = new DefaultVehicleParkingRepository(); realTimeUpdateContext = new DefaultRealTimeUpdateContext(graph, timetableRepository); @@ -105,7 +104,11 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - var vehicleParkingInGraph = parkingRepository.getVehicleParkings().findFirst().orElseThrow(); + var vehicleParkingInGraph = parkingRepository + .listVehicleParkings() + .stream() + .findFirst() + .orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); @@ -118,7 +121,8 @@ void updateVehicleParkingTest() { assertVehicleParkingsInGraph(1); - vehicleParkingInGraph = parkingRepository.getVehicleParkings().findFirst().orElseThrow(); + vehicleParkingInGraph = + parkingRepository.listVehicleParkings().stream().findFirst().orElseThrow(); assertEquals(vehiclePlaces, vehicleParkingInGraph.getAvailability()); assertEquals(vehiclePlaces, vehicleParkingInGraph.getCapacity()); } @@ -153,7 +157,7 @@ void addNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingRepository.getVehicleParkings().count()); + assertEquals(1, parkingRepository.listVehicleParkings().size()); assertVehicleParkingNotLinked(); } @@ -170,10 +174,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingRepository.getVehicleParkings().count()); + assertEquals(1, parkingRepository.listVehicleParkings().size()); assertEquals( vehiclePlaces, - parkingRepository.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingRepository.listVehicleParkings().stream().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); @@ -189,10 +193,10 @@ void updateNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingRepository.getVehicleParkings().count()); + assertEquals(1, parkingRepository.listVehicleParkings().size()); assertEquals( vehiclePlaces, - parkingRepository.getVehicleParkings().findFirst().orElseThrow().getAvailability() + parkingRepository.listVehicleParkings().stream().findFirst().orElseThrow().getAvailability() ); assertVehicleParkingNotLinked(); } @@ -207,12 +211,12 @@ void deleteNotOperatingVehicleParkingTest() { when(dataSource.getUpdates()).thenReturn(List.of(vehicleParking)); runUpdaterOnce(); - assertEquals(1, parkingRepository.getVehicleParkings().count()); + assertEquals(1, parkingRepository.listVehicleParkings().size()); when(dataSource.getUpdates()).thenReturn(List.of()); runUpdaterOnce(); - assertEquals(0, parkingRepository.getVehicleParkings().count()); + assertEquals(0, parkingRepository.listVehicleParkings().size()); } private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { @@ -253,17 +257,13 @@ private void assertVehicleParkingsInGraph(int vehicleParkingNumber) { ); } - assertEquals(vehicleParkingNumber, parkingRepository.getVehicleParkings().count()); + assertEquals(vehicleParkingNumber, parkingRepository.listVehicleParkings().size()); } private void runUpdaterOnce() { class GraphUpdaterMock extends GraphUpdaterManager { - public GraphUpdaterMock( - Graph graph, - TimetableRepository timetableRepository, - List updaters - ) { + public GraphUpdaterMock(List updaters) { super(realTimeUpdateContext, updaters); } @@ -274,11 +274,7 @@ public Future execute(GraphWriterRunnable runnable) { } } - var graphUpdaterManager = new GraphUpdaterMock( - graph, - timetableRepository, - List.of(vehicleParkingUpdater) - ); + var graphUpdaterManager = new GraphUpdaterMock(List.of(vehicleParkingUpdater)); graphUpdaterManager.startUpdaters(); graphUpdaterManager.stop(false); } From 5bf1fc09a35a82e744f2b18e247bc68e5687af08 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 21 Nov 2024 16:26:26 +0100 Subject: [PATCH 19/55] Apply review feedback --- .../apis/transmodel/model/network/GroupOfLinesType.java | 4 +++- .../apis/transmodel/model/siri/et/EstimatedCallType.java | 2 +- .../apis/transmodel/model/siri/sx/AffectsType.java | 4 ++-- .../model/timetable/DatedServiceJourneyQuery.java | 2 +- .../plan/legreference/ScheduledTransitLegReference.java | 2 +- .../algorithm/mapping/RaptorPathToItineraryMapper.java | 2 +- .../routing/alternativelegs/AlternativeLegs.java | 2 +- .../transit/service/DefaultTransitService.java | 6 +++--- .../org/opentripplanner/transit/service/TransitService.java | 6 +++--- .../org/opentripplanner/updater/siri/EntityResolver.java | 6 +++--- .../updater/siri/SiriTimetableSnapshotSourceTest.java | 4 ++-- .../updater/trip/RealtimeTestEnvironment.java | 4 ++-- 12 files changed, 23 insertions(+), 21 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java index edd69e20853..6e52c6662a4 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/network/GroupOfLinesType.java @@ -70,7 +70,9 @@ public static GraphQLObjectType create() { .name("lines") .description("All lines part of this group of lines") .type(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(LineType.REF)))) - .dataFetcher(env -> GqlUtil.getTransitService(env).findGroupsOfRoutes(env.getSource())) + .dataFetcher(env -> + GqlUtil.getTransitService(env).findRoutes((GroupOfRoutes) env.getSource()) + ) .build() ) .build(); diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java index 64ceb9dde2d..593782af9d8 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/et/EstimatedCallType.java @@ -295,7 +295,7 @@ public static GraphQLObjectType create( .dataFetcher(environment -> GqlUtil .getTransitService(environment) - .findTripOnServiceDate( + .getTripOnServiceDate( new TripIdAndServiceDate( environment.getSource().getTrip().getId(), environment.getSource().getServiceDay() diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java index 319df8988e3..e8cbec6ade0 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/siri/sx/AffectsType.java @@ -109,7 +109,7 @@ public static GraphQLOutputType create( EntitySelector.Trip entitySelector = environment.getSource(); return GqlUtil .getTransitService(environment) - .findTripOnServiceDate( + .getTripOnServiceDate( new TripIdAndServiceDate(entitySelector.tripId(), entitySelector.serviceDate()) ); }) @@ -219,7 +219,7 @@ public static GraphQLOutputType create( EntitySelector.StopAndTrip entitySelector = environment.getSource(); return GqlUtil .getTransitService(environment) - .findTripOnServiceDate( + .getTripOnServiceDate( new TripIdAndServiceDate(entitySelector.tripId(), entitySelector.serviceDate()) ); }) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java index 2d95c1fce17..56267c6992d 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java @@ -34,7 +34,7 @@ public static GraphQLFieldDefinition createGetById(GraphQLOutputType datedServic .dataFetcher(environment -> { FeedScopedId id = TransitIdMapper.mapIDToDomain(environment.getArgument("id")); - return GqlUtil.getTransitService(environment).findTripOnServiceDate(id); + return GqlUtil.getTransitService(environment).getTripOnServiceDate(id); }) .build(); } diff --git a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java index 0eb6926055e..5defff73cec 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java +++ b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java @@ -69,7 +69,7 @@ public ScheduledTransitLeg getLeg(TransitService transitService) { Trip trip; TripOnServiceDate tripOnServiceDate = null; if (tripOnServiceDateId != null) { - tripOnServiceDate = transitService.findTripOnServiceDate(tripOnServiceDateId); + tripOnServiceDate = transitService.getTripOnServiceDate(tripOnServiceDateId); if (tripOnServiceDate == null) { LOG.info( "Invalid transit leg reference: trip on service date '{}' not found", diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java index c30c7c655f8..014d17a8f48 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java @@ -279,7 +279,7 @@ private TripOnServiceDate getTripOnServiceDate(T tripSchedule) { tripSchedule.getOriginalTripTimes().getTrip().getId(), tripSchedule.getServiceDate() ); - return transitService.findTripOnServiceDate(tripIdAndServiceDate); + return transitService.getTripOnServiceDate(tripIdAndServiceDate); } private boolean isFree(EgressPathLeg egressPathLeg) { diff --git a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java index 98f48786215..f65a045a8e3 100644 --- a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java +++ b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java @@ -229,7 +229,7 @@ private static ScheduledTransitLeg mapToLeg( tripTimes.getArrivalTime(alightingPosition) ); - TripOnServiceDate tripOnServiceDate = transitService.findTripOnServiceDate( + TripOnServiceDate tripOnServiceDate = transitService.getTripOnServiceDate( new TripIdAndServiceDate(tripTimeOnDate.getTrip().getId(), tripTimeOnDate.getServiceDay()) ); diff --git a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index 3eb75521fb3..3a775e44731 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -475,7 +475,7 @@ public Collection listGroupsOfRoutes() { } @Override - public Collection findGroupsOfRoutes(GroupOfRoutes groupOfRoutes) { + public Collection findRoutes(GroupOfRoutes groupOfRoutes) { OTPRequestTimeoutException.checkForTimeout(); return timetableRepositoryIndex.getRoutesForGroupOfRoutes(groupOfRoutes); } @@ -531,7 +531,7 @@ private TimetableSnapshot lazyGetTimeTableSnapShot() { } @Override - public TripOnServiceDate findTripOnServiceDate(FeedScopedId tripOnServiceDateId) { + public TripOnServiceDate getTripOnServiceDate(FeedScopedId tripOnServiceDateId) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripOnServiceDate tripOnServiceDate = currentSnapshot.getRealTimeAddedTripOnServiceDateById( @@ -557,7 +557,7 @@ public Collection listTripsOnServiceDate() { } @Override - public TripOnServiceDate findTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate) { + public TripOnServiceDate getTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripOnServiceDate tripOnServiceDate = currentSnapshot.getRealTimeAddedTripOnServiceDateForTripAndDay( diff --git a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java index 5290470973d..3a6a8cfd61d 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java @@ -212,7 +212,7 @@ List findTripTimeOnDate( Collection listGroupsOfRoutes(); - Collection findGroupsOfRoutes(GroupOfRoutes groupOfRoutes); + Collection findRoutes(GroupOfRoutes groupOfRoutes); @Nullable GroupOfRoutes getGroupOfRoutes(FeedScopedId id); @@ -237,12 +237,12 @@ List findTripTimeOnDate( */ boolean hasNewTripPatternsForModifiedTrips(); - TripOnServiceDate findTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate); + TripOnServiceDate getTripOnServiceDate(TripIdAndServiceDate tripIdAndServiceDate); /** * Return the TripOnServiceDate for a given id, including real-time updates. */ - TripOnServiceDate findTripOnServiceDate(FeedScopedId datedServiceJourneyId); + TripOnServiceDate getTripOnServiceDate(FeedScopedId datedServiceJourneyId); Collection listTripsOnServiceDate(); diff --git a/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java b/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java index d3b41588f31..47eb45ad287 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/EntityResolver.java @@ -54,7 +54,7 @@ public Trip resolveTrip(EstimatedVehicleJourney journey) { if (journey.getDatedVehicleJourneyRef() != null) { String datedServiceJourneyId = journey.getDatedVehicleJourneyRef().getValue(); - TripOnServiceDate tripOnServiceDate = transitService.findTripOnServiceDate( + TripOnServiceDate tripOnServiceDate = transitService.getTripOnServiceDate( resolveId(datedServiceJourneyId) ); @@ -113,13 +113,13 @@ public TripOnServiceDate resolveTripOnServiceDate( return null; } - return transitService.findTripOnServiceDate( + return transitService.getTripOnServiceDate( new TripIdAndServiceDate(resolveId(serviceJourneyId), serviceDate) ); } public TripOnServiceDate resolveTripOnServiceDate(FeedScopedId datedServiceJourneyId) { - return transitService.findTripOnServiceDate(datedServiceJourneyId); + return transitService.getTripOnServiceDate(datedServiceJourneyId); } public FeedScopedId resolveDatedServiceJourneyId( diff --git a/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java b/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java index 5bf700cc04a..fea39f912db 100644 --- a/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java +++ b/application/src/test/java/org/opentripplanner/updater/siri/SiriTimetableSnapshotSourceTest.java @@ -74,9 +74,9 @@ void testAddJourneyWithExistingRoute() { Trip trip = transitService.getTrip(tripId); assertNotNull(trip); assertNotNull(transitService.findPattern(trip)); - assertNotNull(transitService.findTripOnServiceDate(tripId)); + assertNotNull(transitService.getTripOnServiceDate(tripId)); assertNotNull( - transitService.findTripOnServiceDate(new TripIdAndServiceDate(tripId, SERVICE_DATE)) + transitService.getTripOnServiceDate(new TripIdAndServiceDate(tripId, SERVICE_DATE)) ); assertEquals( numPatternForRoute + 1, diff --git a/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java b/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java index f892327eb81..f20e58a7b62 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/RealtimeTestEnvironment.java @@ -96,7 +96,7 @@ public TransitService getTransitService() { */ public TripTimes getTripTimesForTrip(FeedScopedId tripId, LocalDate serviceDate) { var transitService = getTransitService(); - var trip = transitService.findTripOnServiceDate(tripId).getTrip(); + var trip = transitService.getTripOnServiceDate(tripId).getTrip(); var pattern = transitService.findPattern(trip, serviceDate); var timetable = transitService.findTimetable(pattern, serviceDate); return timetable.getTripTimes(trip); @@ -120,7 +120,7 @@ public TripPattern getPatternForTrip(String id) { public TripPattern getPatternForTrip(FeedScopedId tripId, LocalDate serviceDate) { var transitService = getTransitService(); - var trip = transitService.findTripOnServiceDate(tripId); + var trip = transitService.getTripOnServiceDate(tripId); return transitService.findPattern(trip.getTrip(), serviceDate); } From 6186451c845dc4e29b70963d2edb5694c2038f3f Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 21 Nov 2024 19:14:22 +0100 Subject: [PATCH 20/55] Split the shaded jar out of application --- application/pom.xml | 81 +------------------------- pom.xml | 3 + raptor/pom.xml | 2 +- shaded-jar/pom.xml | 134 ++++++++++++++++++++++++++++++++++++++++++++ utils/pom.xml | 2 +- 5 files changed, 142 insertions(+), 80 deletions(-) create mode 100644 shaded-jar/pom.xml diff --git a/application/pom.xml b/application/pom.xml index 3fc0193d0af..4b11f1f6527 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -8,7 +8,7 @@ otp-root 2.7.0-SNAPSHOT - otp + application OpenTripPlanner - Application @@ -20,12 +20,12 @@ ${project.groupId} - otp-utils + utils ${project.version} ${project.groupId} - otp-raptor + raptor ${project.version} @@ -456,81 +456,6 @@ - - - - org.apache.maven.plugins - maven-shade-plugin - 3.6.0 - - - package - - shade - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - true - shaded - false - - - - - - - org.opentripplanner.standalone.OTPMain - - Java Advanced Imaging Image I/O - Tools - - 1.1 - Sun Microsystems, Inc. - com.sun.media.imageio - 1.1 - Sun Microsystems, Inc. - com.sun.media.imageio - - - - - - - com.github.bohnman package-info-maven-plugin diff --git a/pom.xml b/pom.xml index b520f3cad63..346dadf50c9 100644 --- a/pom.xml +++ b/pom.xml @@ -98,6 +98,7 @@ gtfs-realtime-protobuf utils raptor + shaded-jar @@ -131,6 +132,7 @@ ${otp.serialization.version.id} + true @@ -143,6 +145,7 @@ ${basedir}/doc/javadoc javadoc + true diff --git a/raptor/pom.xml b/raptor/pom.xml index d2d93e36f9d..b0bb86317e1 100644 --- a/raptor/pom.xml +++ b/raptor/pom.xml @@ -9,7 +9,7 @@ 2.7.0-SNAPSHOT - otp-raptor + raptor OpenTripPlanner - Raptor diff --git a/shaded-jar/pom.xml b/shaded-jar/pom.xml new file mode 100644 index 00000000000..fbea5d99fca --- /dev/null +++ b/shaded-jar/pom.xml @@ -0,0 +1,134 @@ + + + 4.0.0 + + org.opentripplanner + otp-root + 2.7.0-SNAPSHOT + + shaded-jar + pom + OpenTripPlanner - Shaded Jar + + + skip + + + + + + ${project.groupId} + application + ${project.version} + + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + ${build.directory}/otp-${project.version}-shaded.jar + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + true + + false + + + + + + + org.opentripplanner.standalone.OTPMain + + Java Advanced Imaging Image I/O + Tools + + 1.1 + Sun Microsystems, Inc. + com.sun.media.imageio + 1.1 + Sun Microsystems, Inc. + + com.sun.media.imageio + + + + + + + + + + shaded-jar + + + + org.apache.maven.plugins + maven-shade-plugin + + + install + + shade + + + + + + + + + diff --git a/utils/pom.xml b/utils/pom.xml index 7a223488dd0..2e70554a678 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -9,7 +9,7 @@ 2.7.0-SNAPSHOT - otp-utils + utils OpenTripPlanner - Utils From f3121446ecffee3c539ce287b7f45f09a099c4b4 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 22 Nov 2024 21:34:12 +0100 Subject: [PATCH 21/55] Fix NPE when fetching minimumBookingNotice --- .../ext/restapi/mapping/BookingInfoMapper.java | 4 ++-- .../apis/gtfs/datafetchers/BookingInfoImpl.java | 5 +++-- .../transit/model/timetable/booking/BookingInfo.java | 11 +++++------ .../model/timetable/booking/RoutingBookingInfo.java | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/BookingInfoMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/BookingInfoMapper.java index b4e3292b435..eafa81195b5 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/BookingInfoMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/BookingInfoMapper.java @@ -27,8 +27,8 @@ private static ApiBookingInfo mapBookingInfo(BookingInfo info, boolean isPickup) BookingMethodMapper.mapBookingMethods(info.bookingMethods()), BookingTimeMapper.mapBookingTime(info.getEarliestBookingTime()), BookingTimeMapper.mapBookingTime(info.getLatestBookingTime()), - info.getMinimumBookingNotice(), - info.getMaximumBookingNotice(), + info.getMinimumBookingNotice().orElse(null), + info.getMaximumBookingNotice().orElse(null), info.getMessage(), isPickup ? info.getPickupMessage() : null, !isPickup ? info.getDropOffMessage() : null diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java index 44ee0985542..a3ffda526db 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java @@ -2,6 +2,7 @@ import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; +import java.time.Duration; import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.transit.model.organization.ContactInfo; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; @@ -31,7 +32,7 @@ public DataFetcher latestBookingTime() { @Override public DataFetcher maximumBookingNoticeSeconds() { - return environment -> getSource(environment).getMaximumBookingNotice().toSeconds(); + return environment -> getSource(environment).getMaximumBookingNotice().map(Duration::toSeconds).orElse(null); } @Override @@ -41,7 +42,7 @@ public DataFetcher message() { @Override public DataFetcher minimumBookingNoticeSeconds() { - return environment -> getSource(environment).getMinimumBookingNotice().toSeconds(); + return environment -> getSource(environment).getMinimumBookingNotice().map(Duration::toSeconds).orElse(null); } @Override diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java index b21543b717c..8b48a61ffbe 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java @@ -3,6 +3,7 @@ import java.io.Serializable; import java.time.Duration; import java.util.EnumSet; +import java.util.Optional; import javax.annotation.Nullable; import org.opentripplanner.transit.model.organization.ContactInfo; import org.opentripplanner.utils.tostring.ToStringBuilder; @@ -99,14 +100,12 @@ public BookingTime getLatestBookingTime() { return latestBookingTime; } - @Nullable - public Duration getMinimumBookingNotice() { - return minimumBookingNotice; + public Optional getMinimumBookingNotice() { + return Optional.ofNullable(minimumBookingNotice); } - @Nullable - public Duration getMaximumBookingNotice() { - return maximumBookingNotice; + public Optional getMaximumBookingNotice() { + return Optional.ofNullable(maximumBookingNotice); } @Nullable diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java index 471cff394e2..11ea27d48aa 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java @@ -151,17 +151,17 @@ Builder withBookingInfo(@Nullable BookingInfo bookingInfo) { return this; } withLatestBookingTime(bookingInfo.getLatestBookingTime()); - withMinimumBookingNotice(bookingInfo.getMinimumBookingNotice()); + withMinimumBookingNotice(bookingInfo.getMinimumBookingNotice().orElse(null)); return this; } - public Builder withLatestBookingTime(BookingTime latestBookingTime) { + public Builder withLatestBookingTime(@Nullable BookingTime latestBookingTime) { this.latestBookingTime = latestBookingTime == null ? NOT_SET : latestBookingTime.relativeTimeSeconds(); return this; } - public Builder withMinimumBookingNotice(Duration minimumBookingNotice) { + public Builder withMinimumBookingNotice(@Nullable Duration minimumBookingNotice) { this.minimumBookingNotice = minimumBookingNotice == null ? NOT_SET : (int) minimumBookingNotice.toSeconds(); return this; From a14df652c8cbf3984aabf59863fd2305e0d905e1 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 22 Nov 2024 22:02:16 +0100 Subject: [PATCH 22/55] Add test --- .../datafetchers/BookingInfoImplTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java new file mode 100644 index 00000000000..9ab76fae1ca --- /dev/null +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java @@ -0,0 +1,43 @@ +package org.opentripplanner.apis.gtfs.datafetchers; + +import static graphql.execution.ExecutionContextBuilder.newExecutionContextBuilder; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import graphql.ExecutionInput; +import graphql.execution.ExecutionId; +import graphql.schema.DataFetchingEnvironmentImpl; +import java.time.Duration; +import java.util.Locale; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.opentripplanner.transit.model.timetable.booking.BookingInfo; + +class BookingInfoImplTest { + + @Test + void map() throws Exception { + + ExecutionInput executionInput = ExecutionInput + .newExecutionInput() + .query("") + .operationName("plan") + .locale(Locale.ENGLISH) + .build(); + + var executionContext = newExecutionContextBuilder() + .executionInput(executionInput) + .executionId(ExecutionId.from(this.getClass().getName())) + .build(); + var env = DataFetchingEnvironmentImpl + .newDataFetchingEnvironment(executionContext) + .arguments(Map.of()) + .source(BookingInfo.of().withMinimumBookingNotice(Duration.ofMinutes(10)).build()) + .build(); + var impl = new BookingInfoImpl(); + var seconds = impl.minimumBookingNoticeSeconds().get(env); + assertEquals(600, seconds); + } + + + +} \ No newline at end of file From 91d67845e70cb7ba78c7cb44dd7b646003fa908c Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 22 Nov 2024 22:14:44 +0100 Subject: [PATCH 23/55] Add tests --- .../gtfs/datafetchers/BookingInfoImpl.java | 6 +- .../datafetchers/BookingInfoImplTest.java | 59 ++++++++++--------- .../netex/mapping/BookingInfoMapperTest.java | 2 +- .../timetable/booking/BookingInfoTest.java | 2 +- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java index a3ffda526db..0060e6ad7e1 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImpl.java @@ -32,7 +32,8 @@ public DataFetcher latestBookingTime() { @Override public DataFetcher maximumBookingNoticeSeconds() { - return environment -> getSource(environment).getMaximumBookingNotice().map(Duration::toSeconds).orElse(null); + return environment -> + getSource(environment).getMaximumBookingNotice().map(Duration::toSeconds).orElse(null); } @Override @@ -42,7 +43,8 @@ public DataFetcher message() { @Override public DataFetcher minimumBookingNoticeSeconds() { - return environment -> getSource(environment).getMinimumBookingNotice().map(Duration::toSeconds).orElse(null); + return environment -> + getSource(environment).getMinimumBookingNotice().map(Duration::toSeconds).orElse(null); } @Override diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java index 9ab76fae1ca..1103024aa61 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/datafetchers/BookingInfoImplTest.java @@ -2,42 +2,47 @@ import static graphql.execution.ExecutionContextBuilder.newExecutionContextBuilder; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; -import graphql.ExecutionInput; import graphql.execution.ExecutionId; +import graphql.schema.DataFetchingEnvironment; import graphql.schema.DataFetchingEnvironmentImpl; import java.time.Duration; -import java.util.Locale; -import java.util.Map; import org.junit.jupiter.api.Test; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; class BookingInfoImplTest { - @Test - void map() throws Exception { + private static final BookingInfoImpl SUBJECT = new BookingInfoImpl(); + private static final Duration TEN_MINUTES = Duration.ofMinutes(10); - ExecutionInput executionInput = ExecutionInput - .newExecutionInput() - .query("") - .operationName("plan") - .locale(Locale.ENGLISH) - .build(); + @Test + void emptyDurations() throws Exception { + var env = dataFetchingEnvironment(BookingInfo.of().build()); + assertNull(SUBJECT.minimumBookingNoticeSeconds().get(env)); + assertNull(SUBJECT.maximumBookingNoticeSeconds().get(env)); + } - var executionContext = newExecutionContextBuilder() - .executionInput(executionInput) - .executionId(ExecutionId.from(this.getClass().getName())) - .build(); - var env = DataFetchingEnvironmentImpl - .newDataFetchingEnvironment(executionContext) - .arguments(Map.of()) - .source(BookingInfo.of().withMinimumBookingNotice(Duration.ofMinutes(10)).build()) - .build(); - var impl = new BookingInfoImpl(); - var seconds = impl.minimumBookingNoticeSeconds().get(env); - assertEquals(600, seconds); - } - - + @Test + void durations() throws Exception { + var env = dataFetchingEnvironment( + BookingInfo + .of() + .withMinimumBookingNotice(TEN_MINUTES) + .withMaximumBookingNotice(TEN_MINUTES) + .build() + ); + assertEquals(600, SUBJECT.minimumBookingNoticeSeconds().get(env)); + assertEquals(600, SUBJECT.maximumBookingNoticeSeconds().get(env)); + } -} \ No newline at end of file + private DataFetchingEnvironment dataFetchingEnvironment(BookingInfo bookingInfo) { + var executionContext = newExecutionContextBuilder() + .executionId(ExecutionId.from(this.getClass().getName())) + .build(); + return DataFetchingEnvironmentImpl + .newDataFetchingEnvironment(executionContext) + .source(bookingInfo) + .build(); + } +} diff --git a/application/src/test/java/org/opentripplanner/netex/mapping/BookingInfoMapperTest.java b/application/src/test/java/org/opentripplanner/netex/mapping/BookingInfoMapperTest.java index e561a6155d3..7b917dcf912 100644 --- a/application/src/test/java/org/opentripplanner/netex/mapping/BookingInfoMapperTest.java +++ b/application/src/test/java/org/opentripplanner/netex/mapping/BookingInfoMapperTest.java @@ -193,6 +193,6 @@ void testMapMinimumBookingNotice() { BookingInfo bookingInfo = subject.map(stopPoint, null, null); - assertEquals(THIRTY_MINUTES, bookingInfo.getMinimumBookingNotice()); + assertEquals(THIRTY_MINUTES, bookingInfo.getMinimumBookingNotice().get()); } } diff --git a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingInfoTest.java b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingInfoTest.java index 0bf189a1c29..36587e1f696 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingInfoTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingInfoTest.java @@ -58,7 +58,7 @@ void testBookingInfoWithMinBookingNotice() { .build(); assertNull(subject.getLatestBookingTime()); - assertEquals(minimumBookingNotice, subject.getMinimumBookingNotice()); + assertEquals(minimumBookingNotice, subject.getMinimumBookingNotice().get()); assertEquals( "BookingInfo{bookingMethods: [CALL_DRIVER], minimumBookingNotice: 45m}", From c3780efdc991e8dead9bec4ce4e3f534d2a28902 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 04:54:32 +0000 Subject: [PATCH 24/55] Update geotools.version to v32.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b520f3cad63..d7c2fdeeec7 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 172 - 32.0 + 32.1 2.52 2.18.1 3.1.9 From 8f66e1a0c4bd3c5aad1934493b56b671393cdd40 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 26 Nov 2024 13:22:54 +0100 Subject: [PATCH 25/55] refactor: Use ${project.build.directory} not ${build.directory} inMaven POM --- shaded-jar/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaded-jar/pom.xml b/shaded-jar/pom.xml index fbea5d99fca..beb88b5d08a 100644 --- a/shaded-jar/pom.xml +++ b/shaded-jar/pom.xml @@ -59,7 +59,7 @@ "otp-SNAPSHOT-shaded.pom". Changing the packaging of the project is not what we want either. --> - ${build.directory}/otp-${project.version}-shaded.jar + ${project.build.directory}/otp-${project.version}-shaded.jar From 51faf2c23efcca1ed8711b887c18c4df409a3e77 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 26 Nov 2024 15:07:42 +0100 Subject: [PATCH 26/55] refactor: Fix the raptor dependency on otp utils. --- pom.xml | 5 ++--- raptor/pom.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 346dadf50c9..72c80bfc662 100644 --- a/pom.xml +++ b/pom.xml @@ -94,10 +94,10 @@ - application - gtfs-realtime-protobuf utils raptor + gtfs-realtime-protobuf + application shaded-jar @@ -132,7 +132,6 @@ ${otp.serialization.version.id} - true diff --git a/raptor/pom.xml b/raptor/pom.xml index b0bb86317e1..faf38e5f6b3 100644 --- a/raptor/pom.xml +++ b/raptor/pom.xml @@ -17,7 +17,7 @@ ${project.groupId} - otp-utils + utils ${project.version} From f6e71491b53f78a843de8addae0a450fc59e1dde Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 26 Nov 2024 16:15:40 +0100 Subject: [PATCH 27/55] refactor: Enable shade-jar by default, skip with '-DskipShadeJar' --- pom.xml | 10 ++++++++++ shaded-jar/pom.xml | 30 ++++++++---------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 72c80bfc662..97fcdc3b52f 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,17 @@ shaded-jar + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + org.apache.maven.plugins diff --git a/shaded-jar/pom.xml b/shaded-jar/pom.xml index beb88b5d08a..5709ef8245f 100644 --- a/shaded-jar/pom.xml +++ b/shaded-jar/pom.xml @@ -14,6 +14,7 @@ skip + false @@ -48,7 +49,6 @@ properly if some input files are missing a terminating newline) --> org.apache.maven.plugins maven-shade-plugin - 3.6.0 true @@ -107,28 +108,13 @@ + + + build-shaded-jar + shade + + - - - shaded-jar - - - - org.apache.maven.plugins - maven-shade-plugin - - - install - - shade - - - - - - - - From 7df8f99371d16c45229285cc9697bd67bb8db6c0 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 26 Nov 2024 20:50:31 +0100 Subject: [PATCH 28/55] Analysis and design documentation --- DEVELOPMENT_DECISION_RECORDS.md | 6 +++ doc/dev/decisionrecords/AnalysesAndDesign.md | 51 ++++++++++++++++++++ doc/dev/images/DomainModelNotation.svg | 4 ++ 3 files changed, 61 insertions(+) create mode 100644 doc/dev/decisionrecords/AnalysesAndDesign.md create mode 100644 doc/dev/images/DomainModelNotation.svg diff --git a/DEVELOPMENT_DECISION_RECORDS.md b/DEVELOPMENT_DECISION_RECORDS.md index 44aa031954f..2625be325e8 100644 --- a/DEVELOPMENT_DECISION_RECORDS.md +++ b/DEVELOPMENT_DECISION_RECORDS.md @@ -19,6 +19,12 @@ Use established terminology from GTFS, NeTEx or the existing OTP code. Make sure to read and understand. [Follow naming conventions](doc/dev/decisionrecords/NamingConventions.md#naming-conventions) . +## Do Analysis-and-design if needed + +Be prepared to provide [analyses and/or design documentation](doc/dev/decisionrecords/AnalysesAndDesign.md) +if a task is complex, changes the core model and/or the main APIs. + + ## Write-Code-Documentation - Use JavaDoc Document the business intention and decisions in the relevant code. Do not repeat the logic diff --git a/doc/dev/decisionrecords/AnalysesAndDesign.md b/doc/dev/decisionrecords/AnalysesAndDesign.md new file mode 100644 index 00000000000..dbfca09c693 --- /dev/null +++ b/doc/dev/decisionrecords/AnalysesAndDesign.md @@ -0,0 +1,51 @@ +# Analysis and design + +We want to get better at design, so we want some documentation up font for large changes. If a +problem is complex, changes the core OTP model, and/or the API significantly, then the developer +requesting a change should be prepared to provide some design documentation. + +The analysis should be started and at least mapped out in an issue. The design can be documented +in the issue or the PR. + + +## Analysis & Design + +A discussion in a developer meeting is usually a good point to start. + +- Ask what is expected? +- Diagrams beat words in most cases, and help focus on the problem - not implementation details. + + +### Artifacts + +We usually do not require a long list of requirements and analyses documentation. But these +artifacts may help, none of these are required. Ask in the developer meeting what to expect. + + - [ ] Summarise the discussion in the developer meeting in the issue or PR. + - [ ] List use-cases, one sentence per use-case is often enough. + - [ ] In/out matrix, list features you are NOT planning to implement. + - [ ] Draw diagrams + - [ ] **Domain model** — If the core model or APIs are significantly changed + - [ ] State diagram + - [ ] Collaboration diagram + + +## Domain model + +A domain model focus on the language and the relationships. All implementation details can be left +out. Details witch is not relevant for the problem you are solving can also be left out, focus on +the elements witch helps understand the problem. Use plain english and not tech to describe +the model. For example, only listing the field name, and not the type is ok if the type is obvious. + +Notation is not important, but try to follow the UML syntax below. You may use more advanced UML +syntax if you want, but keep in mind that you should be able to use the diagram to discuss the +problem with a none developer. A product-owner or other person who knows the domain should with +a little help be able to understand the main parts of the drawing. + +When doing review, focus on the domain problem, not syntax — ask about things you do not understand. + + +### Domain model - notation cheat sheet + +![Domain Model Notation](../images/DomainModelNotation.svg) + diff --git a/doc/dev/images/DomainModelNotation.svg b/doc/dev/images/DomainModelNotation.svg new file mode 100644 index 00000000000..836363f4372 --- /dev/null +++ b/doc/dev/images/DomainModelNotation.svg @@ -0,0 +1,4 @@ + + + +ServicecanceledTrips(...) : TripOnDateEntityfield : basic type / scalarA<<interface>>Baseid : IDEvent/Moment/IntervalValueObjectvalue : String
Colors
Colors
Types
Types
objectName : Type/Class<<interface>>Interface/abstract class
Relationship
Relation...
Afield : basic type / scalarB
b
b
?
?
AB
b
b
B
Inheritance
Inherita...
<< use >>
<< use >>
AB
Dependency
Dependen...
[ Bike only ]
[ Bike only ]
Amode : Mode[ GTFS only ]B
Constraint
Constrai...
  • We usually provide a class name only, but you can provide an object name and/or class. 
  • If something is an abstract class or an interface is a implementation detail. Use the <<interface>>` qualifier to tag interfaces.
We usually provide a class name only, but you can...
  • Relationship can be one way (arrow) or both-ways (no arrows).
  • Naming the relationship is optional.
  • Default cardinality is 1. Other values:
    • ? - optional
    • * - many
    • 2 - exact two
    • 3..n - three or more
  • A simple relationship is included as a field. A good indication when to use a field and not an arrow is when the type is a basic type(int, float, boolean, String), enumeration or ValueObject. PS! It is not wrong to use either, both forms are equivalent
Relationship can be one way (arrow) or both-ways (...
2..n
2..n
*
*
AB
a
a
b
b
  • If you are in doubt model things as relationships, do not use inheritance.
  • Interfaces exist:
    • if there is a reference to it - the named interface play a role.
    • if at least one shared operation/field/relationship exist.  
If you are in doubt model things as relationships,...
  • We draw dependencies when they are important and not part of a relationship. For example if we want to map out the details of a ValueObject.
  • The qualifier text << use >> is optonal.
We draw dependencies when they are important and n...
  • Use "[]" to add a constraint.
  • A constraint can be added to all arrows and types.
  • Be careful with constraints, they add a lot of noice to the diagram. It is sometimes better to just list tem in text.
Use "[]" to add a constraint.A constraint can be a...
A has a field b of type B.
A has a field b of type B.
A has a 2 or more b's of type B. B has many a's of type A.
A has a 2 or more b's of type B. B has many a's of type...
We use color for classify the a type by its life-cycle. A service is request or application scoped, an entity is sable - but may change, a ValueObject do not change, and a Event are temporary. A ValueObject can not reference a Entity, an Entity can not reference a Service and always pay close attention to the design of Events - they are hard to model.  
We use color for classify the a type by its life-cycle. A service is request or application scoped, an entity is sable - but may c...
A has a relationship b, if mode is Bike.
B only exist for GTFS imported elements.
A has a relationship b, if mode is Bike....
Text is not SVG - cannot display
\ No newline at end of file From ccd1d9a02e185aca9860e5063a35aa463d5ff912 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 06:30:00 +0000 Subject: [PATCH 29/55] chore(deps): update dependency vite to v6 --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index d511ba477bc..261d73e00b4 100644 --- a/client/package.json +++ b/client/package.json @@ -50,7 +50,7 @@ "jsdom": "25.0.1", "prettier": "3.3.3", "typescript": "5.6.3", - "vite": "5.4.11", + "vite": "6.0.1", "vitest": "2.1.5" } } From bfea1bc154195e2cb2a06611dd01f9742e64752c Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 27 Nov 2024 10:56:18 +0100 Subject: [PATCH 30/55] Apply suggestions from code review Co-authored-by: Leonard Ehrenfried --- doc/dev/decisionrecords/AnalysesAndDesign.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/dev/decisionrecords/AnalysesAndDesign.md b/doc/dev/decisionrecords/AnalysesAndDesign.md index dbfca09c693..4658336812b 100644 --- a/doc/dev/decisionrecords/AnalysesAndDesign.md +++ b/doc/dev/decisionrecords/AnalysesAndDesign.md @@ -1,6 +1,6 @@ # Analysis and design -We want to get better at design, so we want some documentation up font for large changes. If a +We want to get better at design, so we want some documentation up front for large changes. If a problem is complex, changes the core OTP model, and/or the API significantly, then the developer requesting a change should be prepared to provide some design documentation. @@ -19,7 +19,7 @@ A discussion in a developer meeting is usually a good point to start. ### Artifacts We usually do not require a long list of requirements and analyses documentation. But these -artifacts may help, none of these are required. Ask in the developer meeting what to expect. +artifacts may help, but none of these are required. Ask in the developer meeting what to expect. - [ ] Summarise the discussion in the developer meeting in the issue or PR. - [ ] List use-cases, one sentence per use-case is often enough. @@ -32,14 +32,14 @@ artifacts may help, none of these are required. Ask in the developer meeting wha ## Domain model -A domain model focus on the language and the relationships. All implementation details can be left -out. Details witch is not relevant for the problem you are solving can also be left out, focus on +A domain model focusses on the language and the relationships. All implementation details can be left +out. Details which is not relevant for the problem you are solving can also be left out, focus on the elements witch helps understand the problem. Use plain english and not tech to describe the model. For example, only listing the field name, and not the type is ok if the type is obvious. Notation is not important, but try to follow the UML syntax below. You may use more advanced UML syntax if you want, but keep in mind that you should be able to use the diagram to discuss the -problem with a none developer. A product-owner or other person who knows the domain should with +problem with a non-developer. A product-owner or other person who knows the domain should with a little help be able to understand the main parts of the drawing. When doing review, focus on the domain problem, not syntax — ask about things you do not understand. From 307e5393e855d29f513ad28ec410fc53ead905b3 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 27 Nov 2024 11:26:27 +0100 Subject: [PATCH 31/55] doc: Add recommendation for drawing tool --- doc/dev/decisionrecords/AnalysesAndDesign.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/decisionrecords/AnalysesAndDesign.md b/doc/dev/decisionrecords/AnalysesAndDesign.md index 4658336812b..b6c585ba71f 100644 --- a/doc/dev/decisionrecords/AnalysesAndDesign.md +++ b/doc/dev/decisionrecords/AnalysesAndDesign.md @@ -29,6 +29,9 @@ artifacts may help, but none of these are required. Ask in the developer meeting - [ ] State diagram - [ ] Collaboration diagram +We recommend using [draw.io](https://www.drawio.com/). It is free and available as an Intellij +plugin (Diagrams.net), web application and desktop application. + ## Domain model From 90068af8a875600964e8d5adde966fefb7118379 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 27 Nov 2024 11:26:42 +0100 Subject: [PATCH 32/55] doc: Fix broken links --- ARCHITECTURE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index cf3efcd84a3..36ab454789a 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -55,7 +55,7 @@ Used to import NeTEx transit data files. ### Transit Routing -#### [Raptor transit routing](application/src/main/java/org/opentripplanner/raptor/package.md) +#### [Raptor transit routing](raptor/src/main/java/org/opentripplanner/raptor/package.md) This is the OTP2 new transit routing engine implemented using the Raptor algorithm. It explains how Raptor works, the important concepts and the design. It might be worth reading even if you are not a @@ -71,9 +71,9 @@ implementation is highly critical code, hence we set the bar higher with respect OTP provides transit data to Raptor by implementing the _raptor/spi_. The [RoutingService](application/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java) is responsible for mapping from the OTP context to a -[RaptorRequest](application/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java) +[RaptorRequest](raptor/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java) and then map the -result, [Raptor Path](application/src/main/java/org/opentripplanner/raptor/api/path/RaptorPath.java), back to +result, [Raptor Path](raptor/src/main/java/org/opentripplanner/raptor/api/path/RaptorPath.java), back to the OTP internal domain. This might seem like a lot of unnecessary mapping, but mapping is simple - routing is not. From 1d27bc245d88bba22f483ebbff29d457faf2700a Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 27 Nov 2024 13:29:47 +0100 Subject: [PATCH 33/55] Apply suggestions from code review Co-authored-by: Thomas Gran --- .../vehicleparking/internal/DefaultVehicleParkingService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java index cb4f6680b82..ef6be50a253 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -52,7 +52,7 @@ public Collection listVehicleParkings() { } @Override - public ImmutableListMultimap listVehicleParkingGroups() { + public ListMultimap listVehicleParkingGroups() { return repository.getVehicleParkingGroups(); } From b2357d1c2be5c0e7830f1446028db6e5b9c6d713 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 27 Nov 2024 13:34:42 +0100 Subject: [PATCH 34/55] Return more abstract types --- .../service/vehicleparking/VehicleParkingRepository.java | 4 ++-- .../internal/DefaultVehicleParkingRepository.java | 3 ++- .../vehicleparking/internal/DefaultVehicleParkingService.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java index ae4094d904e..7d9e4f110ce 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/VehicleParkingRepository.java @@ -1,6 +1,6 @@ package org.opentripplanner.service.vehicleparking; -import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ListMultimap; import java.util.Collection; import org.opentripplanner.service.vehicleparking.model.VehicleParking; import org.opentripplanner.service.vehicleparking.model.VehicleParkingGroup; @@ -15,5 +15,5 @@ void updateVehicleParking( ); Collection listVehicleParkings(); - ImmutableListMultimap getVehicleParkingGroups(); + ListMultimap getVehicleParkingGroups(); } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java index e0714e74ee8..ef8f9db99bf 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingRepository.java @@ -2,6 +2,7 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; import jakarta.inject.Inject; import jakarta.inject.Singleton; @@ -71,7 +72,7 @@ public Collection listVehicleParkings() { } @Override - public ImmutableListMultimap getVehicleParkingGroups() { + public ListMultimap getVehicleParkingGroups() { return vehicleParkingGroups; } } diff --git a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java index ef6be50a253..b874c4338b7 100644 --- a/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java +++ b/application/src/main/java/org/opentripplanner/service/vehicleparking/internal/DefaultVehicleParkingService.java @@ -1,6 +1,6 @@ package org.opentripplanner.service.vehicleparking.internal; -import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ListMultimap; import jakarta.inject.Inject; import jakarta.inject.Singleton; import java.io.Serializable; From 8a9b964cc7184440aef0c803a7b8f10a1f377af8 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 27 Nov 2024 13:40:44 +0100 Subject: [PATCH 35/55] Use shorter parameter name --- .../transit/service/DefaultTransitService.java | 6 +++--- .../org/opentripplanner/transit/service/TransitService.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index 9af27b8bee2..8557ce21440 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -531,17 +531,17 @@ private TimetableSnapshot lazyGetTimeTableSnapShot() { } @Override - public TripOnServiceDate getTripOnServiceDate(FeedScopedId tripOnServiceDateId) { + public TripOnServiceDate getTripOnServiceDate(FeedScopedId id) { TimetableSnapshot currentSnapshot = lazyGetTimeTableSnapShot(); if (currentSnapshot != null) { TripOnServiceDate tripOnServiceDate = currentSnapshot.getRealTimeAddedTripOnServiceDateById( - tripOnServiceDateId + id ); if (tripOnServiceDate != null) { return tripOnServiceDate; } } - return timetableRepository.getTripOnServiceDateById(tripOnServiceDateId); + return timetableRepository.getTripOnServiceDateById(id); } @Override diff --git a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java index 0caed5417a5..863035950eb 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java @@ -242,7 +242,7 @@ List findTripTimeOnDate( /** * Return the TripOnServiceDate for a given id, including real-time updates. */ - TripOnServiceDate getTripOnServiceDate(FeedScopedId datedServiceJourneyId); + TripOnServiceDate getTripOnServiceDate(FeedScopedId id); Collection listTripsOnServiceDate(); From 1f56e43a0f18b8497bae068d155672041cb41131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Wed, 27 Nov 2024 19:51:14 +0100 Subject: [PATCH 36/55] Upgrade vite react plugin to vite v6 compatible version --- client/package-lock.json | 2039 ++++++++++++++++++++++++++------------ client/package.json | 2 +- 2 files changed, 1430 insertions(+), 611 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index e1e00b4e99d..36c05bdf4f1 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -29,7 +29,7 @@ "@types/react-dom": "18.3.1", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", - "@vitejs/plugin-react": "4.3.3", + "@vitejs/plugin-react": "4.3.4", "@vitest/coverage-v8": "2.1.5", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", @@ -41,7 +41,7 @@ "jsdom": "25.0.1", "prettier": "3.3.3", "typescript": "5.6.3", - "vite": "5.4.11", + "vite": "6.0.1", "vitest": "2.1.5" } }, @@ -215,13 +215,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -229,32 +229,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", - "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", + "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", - "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, - "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/helper-compilation-targets": "^7.25.7", - "@babel/helper-module-transforms": "^7.25.7", - "@babel/helpers": "^7.25.7", - "@babel/parser": "^7.25.8", - "@babel/template": "^7.25.7", - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.8", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -270,13 +268,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7", + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -298,14 +296,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", - "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -374,30 +371,27 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", - "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", - "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -419,11 +413,10 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -485,151 +478,52 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", - "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", - "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", - "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.25.8" + "@babel/types": "^7.26.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -1019,13 +913,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.25.7.tgz", - "integrity": "sha512-JD9MUnLbPL0WdVK8AWC7F7tTG2OS6u/AKKnsK+NdRhUiVdnzyR1S3kKQCaRLOiaULvUiqK6Z4JQE635VgtCFeg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.25.9.tgz", + "integrity": "sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1035,13 +928,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.25.7.tgz", - "integrity": "sha512-S/JXG/KrbIY06iyJPKfxr0qRxnhNOdkNXYBl/rmwgDd72cQLH9tEGkDm/yJPGvcSIUoikzfjMios9i+xT/uv9w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.25.9.tgz", + "integrity": "sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1109,32 +1001,30 @@ } }, "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1143,15 +1033,13 @@ } }, "node_modules/@babel/types": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", - "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1164,394 +1052,387 @@ "dev": true }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", "cpu": [ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", "cpu": [ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", "cpu": [ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", "cpu": [ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", "cpu": [ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", "cpu": [ "mips64el" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", "cpu": [ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", "cpu": [ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", "cpu": [ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", "cpu": [ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -3156,224 +3037,234 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", - "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.4.tgz", + "integrity": "sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==", "cpu": [ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", - "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.4.tgz", + "integrity": "sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", - "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz", + "integrity": "sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", - "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.4.tgz", + "integrity": "sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" ] }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", - "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.4.tgz", + "integrity": "sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==", "cpu": [ - "arm" + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.4.tgz", + "integrity": "sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.4.tgz", + "integrity": "sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==", + "cpu": [ + "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", - "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.4.tgz", + "integrity": "sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==", "cpu": [ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", - "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.4.tgz", + "integrity": "sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", - "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.4.tgz", + "integrity": "sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", - "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.4.tgz", + "integrity": "sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==", "cpu": [ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", - "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.4.tgz", + "integrity": "sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==", "cpu": [ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", - "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.4.tgz", + "integrity": "sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==", "cpu": [ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", - "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz", + "integrity": "sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", - "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz", + "integrity": "sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", - "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.4.tgz", + "integrity": "sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", - "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.4.tgz", + "integrity": "sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==", "cpu": [ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", - "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz", + "integrity": "sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -3491,9 +3382,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/geojson": { @@ -3832,15 +3723,14 @@ "dev": true }, "node_modules/@vitejs/plugin-react": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.3.tgz", - "integrity": "sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.4.tgz", + "integrity": "sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/core": "^7.25.2", - "@babel/plugin-transform-react-jsx-self": "^7.24.7", - "@babel/plugin-transform-react-jsx-source": "^7.24.7", + "@babel/core": "^7.26.0", + "@babel/plugin-transform-react-jsx-self": "^7.25.9", + "@babel/plugin-transform-react-jsx-source": "^7.25.9", "@types/babel__core": "^7.20.5", "react-refresh": "^0.14.2" }, @@ -3848,7 +3738,7 @@ "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0" + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0" } }, "node_modules/@vitest/coverage-v8": { @@ -3900,33 +3790,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/mocker": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", - "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.5", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, "node_modules/@vitest/pretty-format": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", @@ -5562,42 +5425,42 @@ } }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" } }, "node_modules/escalade": { @@ -6129,7 +5992,6 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, - "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -8399,9 +8261,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -8965,11 +8827,10 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "dev": true, - "license": "ISC" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -8993,9 +8854,9 @@ } }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { @@ -9011,10 +8872,9 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -9471,13 +9331,12 @@ } }, "node_modules/rollup": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", - "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.4.tgz", + "integrity": "sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==", "dev": true, - "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -9487,22 +9346,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.2", - "@rollup/rollup-android-arm64": "4.21.2", - "@rollup/rollup-darwin-arm64": "4.21.2", - "@rollup/rollup-darwin-x64": "4.21.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", - "@rollup/rollup-linux-arm-musleabihf": "4.21.2", - "@rollup/rollup-linux-arm64-gnu": "4.21.2", - "@rollup/rollup-linux-arm64-musl": "4.21.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", - "@rollup/rollup-linux-riscv64-gnu": "4.21.2", - "@rollup/rollup-linux-s390x-gnu": "4.21.2", - "@rollup/rollup-linux-x64-gnu": "4.21.2", - "@rollup/rollup-linux-x64-musl": "4.21.2", - "@rollup/rollup-win32-arm64-msvc": "4.21.2", - "@rollup/rollup-win32-ia32-msvc": "4.21.2", - "@rollup/rollup-win32-x64-msvc": "4.21.2", + "@rollup/rollup-android-arm-eabi": "4.27.4", + "@rollup/rollup-android-arm64": "4.27.4", + "@rollup/rollup-darwin-arm64": "4.27.4", + "@rollup/rollup-darwin-x64": "4.27.4", + "@rollup/rollup-freebsd-arm64": "4.27.4", + "@rollup/rollup-freebsd-x64": "4.27.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.27.4", + "@rollup/rollup-linux-arm-musleabihf": "4.27.4", + "@rollup/rollup-linux-arm64-gnu": "4.27.4", + "@rollup/rollup-linux-arm64-musl": "4.27.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.27.4", + "@rollup/rollup-linux-riscv64-gnu": "4.27.4", + "@rollup/rollup-linux-s390x-gnu": "4.27.4", + "@rollup/rollup-linux-x64-gnu": "4.27.4", + "@rollup/rollup-linux-x64-musl": "4.27.4", + "@rollup/rollup-win32-arm64-msvc": "4.27.4", + "@rollup/rollup-win32-ia32-msvc": "4.27.4", + "@rollup/rollup-win32-x64-msvc": "4.27.4", "fsevents": "~2.3.2" } }, @@ -10322,15 +10183,6 @@ "node": ">=0.6.0" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -10731,21 +10583,20 @@ } }, "node_modules/vite": { - "version": "5.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", - "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.1.tgz", + "integrity": "sha512-Ldn6gorLGr4mCdFnmeAOLweJxZ34HjKnDm4HGo6P66IEqTxQb36VEdFJQENKxWjupNfoIjvRUnswjn1hpYEpjQ==", "dev": true, - "license": "MIT", "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" + "esbuild": "^0.24.0", + "postcss": "^8.4.49", + "rollup": "^4.23.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -10754,19 +10605,25 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", - "terser": "^5.4.0" + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "jiti": { + "optional": true + }, "less": { "optional": true }, @@ -10787,6 +10644,12 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, @@ -10813,122 +10676,1078 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/vitest": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", - "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "node_modules/vite-node/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.5", - "@vitest/mocker": "2.1.5", - "@vitest/pretty-format": "^2.1.5", - "@vitest/runner": "2.1.5", - "@vitest/snapshot": "2.1.5", - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", - "chai": "^5.1.2", - "debug": "^4.3.7", - "expect-type": "^1.1.0", - "magic-string": "^0.30.12", - "pathe": "^1.1.2", - "std-env": "^3.8.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.1", - "tinypool": "^1.0.1", - "tinyrainbow": "^1.2.0", - "vite": "^5.0.0", - "vite-node": "2.1.5", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.5", - "@vitest/ui": "2.1.5", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/vt-pbf": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", - "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", - "dependencies": { - "@mapbox/point-geometry": "0.1.0", - "@mapbox/vector-tile": "^1.3.1", - "pbf": "^3.2.1" + "node": ">=12" } }, - "node_modules/w3c-xmlserializer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", - "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "node_modules/vite-node/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "xml-name-validator": "^5.0.0" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=18" - } - }, - "node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" + "node": ">=12" } }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "node_modules/vite-node/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "android" + ], "engines": { "node": ">=12" } }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", + "node_modules/vite-node/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vite-node/node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", + "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.5", + "@vitest/mocker": "2.1.5", + "@vitest/pretty-format": "^2.1.5", + "@vitest/runner": "2.1.5", + "@vitest/snapshot": "2.1.5", + "@vitest/spy": "2.1.5", + "@vitest/utils": "2.1.5", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.5", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.5", + "@vitest/ui": "2.1.5", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", + "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", + "dev": true, + "dependencies": { + "@vitest/spy": "2.1.5", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vitest/node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, @@ -11183,9 +12002,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true, "bin": { "yaml": "bin.mjs" diff --git a/client/package.json b/client/package.json index 261d73e00b4..57320f35540 100644 --- a/client/package.json +++ b/client/package.json @@ -38,7 +38,7 @@ "@types/react-dom": "18.3.1", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", - "@vitejs/plugin-react": "4.3.3", + "@vitejs/plugin-react": "4.3.4", "@vitest/coverage-v8": "2.1.5", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", From 2cc3ce421777221e822d979763135db1bba37cd6 Mon Sep 17 00:00:00 2001 From: OTP Bot Date: Wed, 27 Nov 2024 19:20:22 +0000 Subject: [PATCH 37/55] Upgrade debug client to version 2024/11/2024-11-27T19:19 --- application/src/client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/client/index.html b/application/src/client/index.html index e8872ab33cd..19ee598b816 100644 --- a/application/src/client/index.html +++ b/application/src/client/index.html @@ -5,8 +5,8 @@ OTP Debug Client - - + +
From e1d3a22a4f9db80d27176a348a47ccacaeaeb05e Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Nov 2024 10:57:42 +0100 Subject: [PATCH 38/55] Make ways with motorroad=yes car-only --- .../osm/tagmapping/FinlandMapper.java | 3 -- .../osm/tagmapping/OsmTagMapper.java | 4 +- .../osm/tagmapping/OsmTagMapperTest.java | 42 +++++++++++++------ doc/user/osm/Finland.md | 2 +- doc/user/osm/Germany.md | 1 + doc/user/osm/OsmTag.md | 1 + doc/user/osm/UK.md | 1 + 7 files changed, 36 insertions(+), 18 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/osm/tagmapping/FinlandMapper.java b/application/src/main/java/org/opentripplanner/osm/tagmapping/FinlandMapper.java index e9ac9478552..d9ddd1ede76 100644 --- a/application/src/main/java/org/opentripplanner/osm/tagmapping/FinlandMapper.java +++ b/application/src/main/java/org/opentripplanner/osm/tagmapping/FinlandMapper.java @@ -84,9 +84,6 @@ else if (speedLimit <= 16.65f) { // Don't recommend walking in trunk road tunnels props.setProperties("highway=trunk;tunnel=yes", withModes(CAR).bicycleSafety(7.47)); - // Do not walk on "moottoriliikennetie" - props.setProperties("motorroad=yes", withModes(CAR).bicycleSafety(7.47)); - // Remove informal and private roads props.setProperties("highway=*;informal=yes", withModes(NONE)); props.setProperties("highway=service;access=private", withModes(NONE)); diff --git a/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java b/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java index 2df3c22d6a9..60cd8d0ac74 100644 --- a/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java +++ b/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java @@ -14,7 +14,6 @@ import org.opentripplanner.osm.wayproperty.WayProperties; import org.opentripplanner.osm.wayproperty.WayPropertySet; import org.opentripplanner.osm.wayproperty.specifier.BestMatchSpecifier; -import org.opentripplanner.osm.wayproperty.specifier.Condition; import org.opentripplanner.osm.wayproperty.specifier.ExactMatchSpecifier; import org.opentripplanner.osm.wayproperty.specifier.LogicalOrSpecifier; import org.opentripplanner.routing.services.notes.StreetNotesService; @@ -104,6 +103,9 @@ public void populateProperties(WayPropertySet props) { props.setProperties("highway=trunk", withModes(CAR).bicycleSafety(7.47)); props.setProperties("highway=motorway", withModes(CAR).bicycleSafety(8)); + // Do not walk on "moottoriliikennetie"/"Kraftfahrstrasse" + props.setProperties(new ExactMatchSpecifier("motorroad=yes"), withModes(CAR)); + /* cycleway=lane */ props.setProperties( "highway=*;cycleway=lane", diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java index b3ee57f9710..c5124fbd55a 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java @@ -3,15 +3,18 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; import org.junit.jupiter.api.Test; import org.opentripplanner.osm.model.OsmWithTags; +import org.opentripplanner.osm.wayproperty.WayPropertySet; +import org.opentripplanner.osm.wayproperty.specifier.WayTestData; -public class OsmTagMapperTest { +class OsmTagMapperTest { @Test - public void isMotorThroughTrafficExplicitlyDisallowed() { + void isMotorThroughTrafficExplicitlyDisallowed() { OsmWithTags o = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -34,7 +37,7 @@ public void isMotorThroughTrafficExplicitlyDisallowed() { } @Test - public void isBicycleThroughTrafficExplicitlyDisallowed() { + void isBicycleThroughTrafficExplicitlyDisallowed() { OsmTagMapper osmTagMapper = new OsmTagMapper(); assertTrue( osmTagMapper.isBicycleThroughTrafficExplicitlyDisallowed(way("bicycle", "destination")) @@ -45,14 +48,14 @@ public void isBicycleThroughTrafficExplicitlyDisallowed() { } @Test - public void isWalkThroughTrafficExplicitlyDisallowed() { + void isWalkThroughTrafficExplicitlyDisallowed() { OsmTagMapper osmTagMapper = new OsmTagMapper(); assertTrue(osmTagMapper.isWalkThroughTrafficExplicitlyDisallowed(way("foot", "destination"))); assertTrue(osmTagMapper.isWalkThroughTrafficExplicitlyDisallowed(way("access", "destination"))); } @Test - public void testAccessNo() { + void testAccessNo() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -64,7 +67,7 @@ public void testAccessNo() { } @Test - public void testAccessPrivate() { + void testAccessPrivate() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -76,7 +79,7 @@ public void testAccessPrivate() { } @Test - public void testFootModifier() { + void testFootModifier() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -89,7 +92,7 @@ public void testFootModifier() { } @Test - public void testVehicleDenied() { + void testVehicleDenied() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -101,7 +104,7 @@ public void testVehicleDenied() { } @Test - public void testVehicleDeniedMotorVehiclePermissive() { + void testVehicleDeniedMotorVehiclePermissive() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -114,7 +117,7 @@ public void testVehicleDeniedMotorVehiclePermissive() { } @Test - public void testVehicleDeniedBicyclePermissive() { + void testVehicleDeniedBicyclePermissive() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -127,7 +130,7 @@ public void testVehicleDeniedBicyclePermissive() { } @Test - public void testMotorcycleModifier() { + void testMotorcycleModifier() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -140,7 +143,7 @@ public void testMotorcycleModifier() { } @Test - public void testBicycleModifier() { + void testBicycleModifier() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -153,7 +156,7 @@ public void testBicycleModifier() { } @Test - public void testBicyclePermissive() { + void testBicyclePermissive() { OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new OsmTagMapper(); @@ -165,6 +168,19 @@ public void testBicyclePermissive() { assertTrue(osmTagMapper.isWalkThroughTrafficExplicitlyDisallowed(tags)); } + @Test + void motorroad() { + OsmTagMapper osmTagMapper = new OsmTagMapper(); + WayPropertySet wps = new WayPropertySet(); + osmTagMapper.populateProperties(wps); + + var way = WayTestData.carTunnel(); + assertEquals(ALL, wps.getDataForWay(way).getPermission()); + + way.addTag("motorroad","yes"); + assertEquals(CAR, wps.getDataForWay(way).getPermission()); + } + public OsmWithTags way(String key, String value) { var way = new OsmWithTags(); way.addTag(key, value); diff --git a/doc/user/osm/Finland.md b/doc/user/osm/Finland.md index 8a60b5f0b13..a5a0341bf94 100644 --- a/doc/user/osm/Finland.md +++ b/doc/user/osm/Finland.md @@ -41,7 +41,6 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=trunk_link` | `ALL` | 2.06 | | | `highway=trunk` | `ALL` | 7.47 | | | `highway=trunk; tunnel=yes` | `CAR` | 7.47 | | -| `motorroad=yes` | `CAR` | 7.47 | | | `present(highway); informal=yes` | `NONE` | | | | `highway=service; access=private` | `NONE` | | | | `highway=trail` | `NONE` | | | @@ -105,6 +104,7 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=motorway_link` | `CAR` | 2.06 | | | `highway=trunk` | `CAR` | 7.47 | | | `highway=motorway` | `CAR` | 8.0 | | +| `motorroad=yes` | `CAR` | | | | `present(highway); cycleway=lane` | `PEDESTRIAN_AND_BICYCLE` | 0.87 | | | `highway=service; cycleway=lane` | `ALL` | 0.77 | | | `highway=residential; cycleway=lane` | `ALL` | 0.77 | | diff --git a/doc/user/osm/Germany.md b/doc/user/osm/Germany.md index 922aa3af836..ee9e3982362 100644 --- a/doc/user/osm/Germany.md +++ b/doc/user/osm/Germany.md @@ -70,6 +70,7 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=motorway_link` | `CAR` | 2.06 | | | `highway=trunk` | `CAR` | 7.47 | | | `highway=motorway` | `CAR` | 8.0 | | +| `motorroad=yes` | `CAR` | | | | `present(highway); cycleway=lane` | `PEDESTRIAN_AND_BICYCLE` | 0.87 | | | `highway=service; cycleway=lane` | `ALL` | 0.77 | | | `highway=residential; cycleway=lane` | `ALL` | 0.77 | | diff --git a/doc/user/osm/OsmTag.md b/doc/user/osm/OsmTag.md index 814420b791f..9456dbc9fa5 100644 --- a/doc/user/osm/OsmTag.md +++ b/doc/user/osm/OsmTag.md @@ -61,6 +61,7 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=motorway_link` | `CAR` | 2.06 | | | `highway=trunk` | `CAR` | 7.47 | | | `highway=motorway` | `CAR` | 8.0 | | +| `motorroad=yes` | `CAR` | | | | `present(highway); cycleway=lane` | `PEDESTRIAN_AND_BICYCLE` | 0.87 | | | `highway=service; cycleway=lane` | `ALL` | 0.77 | | | `highway=residential; cycleway=lane` | `ALL` | 0.77 | | diff --git a/doc/user/osm/UK.md b/doc/user/osm/UK.md index 34c4d1c1778..f9d8678fd3c 100644 --- a/doc/user/osm/UK.md +++ b/doc/user/osm/UK.md @@ -77,6 +77,7 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=motorway_link` | `CAR` | 2.06 | | | `highway=trunk` | `CAR` | 7.47 | | | `highway=motorway` | `CAR` | 8.0 | | +| `motorroad=yes` | `CAR` | | | | `present(highway); cycleway=lane` | `PEDESTRIAN_AND_BICYCLE` | 0.87 | | | `highway=service; cycleway=lane` | `ALL` | 0.77 | | | `highway=residential; cycleway=lane` | `ALL` | 0.77 | | From 906819c304bbf1f8801e9cf72c2609326a0b5d89 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Nov 2024 11:15:27 +0100 Subject: [PATCH 39/55] Add test in Finland --- .../osm/tagmapping/FinlandMapperTest.java | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java index f8b07e06bf6..84d9d0ca14e 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java @@ -2,6 +2,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; +import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; @@ -12,15 +14,16 @@ import org.opentripplanner.osm.model.OsmWithTags; import org.opentripplanner.osm.wayproperty.WayProperties; import org.opentripplanner.osm.wayproperty.WayPropertySet; +import org.opentripplanner.osm.wayproperty.specifier.WayTestData; -public class FinlandMapperTest { +class FinlandMapperTest { private WayPropertySet wps; private OsmTagMapper mapper; static float epsilon = 0.01f; @BeforeEach - public void setup() { + void setup() { this.wps = new WayPropertySet(); this.mapper = new FinlandMapper(); this.mapper.populateProperties(this.wps); @@ -30,7 +33,7 @@ public void setup() { * Test that bike and walk safety factors are calculated accurately */ @Test - public void testSafety() { + void testSafety() { OsmWithTags primaryWay = new OsmWithTags(); primaryWay.addTag("highway", "primary"); primaryWay.addTag("oneway", "no"); @@ -141,7 +144,7 @@ public void testSafety() { } @Test - public void testSafetyWithMixins() { + void testSafetyWithMixins() { OsmWithTags wayWithMixins = new OsmWithTags(); // highway=service has no custom bicycle or walk safety wayWithMixins.addTag("highway", "unclassified"); @@ -179,7 +182,7 @@ public void testSafetyWithMixins() { } @Test - public void testTagMapping() { + void testTagMapping() { OsmWithTags way; WayProperties wayData; @@ -206,7 +209,7 @@ public void testTagMapping() { * Test that biking is not allowed in footway areas and transit platforms */ @Test - public void testArea() { + void testArea() { OsmWithTags way; WayProperties wayData; @@ -227,10 +230,21 @@ public void testArea() { } @Test - public void serviceNoThroughTraffic() { + void serviceNoThroughTraffic() { var way = new OsmWay(); way.addTag("highway", "residential"); way.addTag("service", "driveway"); assertTrue(mapper.isMotorVehicleThroughTrafficExplicitlyDisallowed(way)); } + + @Test + void motorroad() { + OsmTagMapper osmTagMapper = new FinlandMapper(); + WayPropertySet wps = new WayPropertySet(); + osmTagMapper.populateProperties(wps); + var way = WayTestData.carTunnel(); + assertEquals(ALL, wps.getDataForWay(way).getPermission()); + way.addTag("motorroad","yes"); + assertEquals(CAR, wps.getDataForWay(way).getPermission()); + } } From 66acd4546379c8b7c7d5a2a85228d84bc07f6cc6 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Nov 2024 11:24:25 +0100 Subject: [PATCH 40/55] Add more test parameters --- .../osm/tagmapping/FinlandMapperTest.java | 2 +- .../osm/tagmapping/OsmTagMapperTest.java | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java index 84d9d0ca14e..ecbd2eec3be 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/FinlandMapperTest.java @@ -244,7 +244,7 @@ void motorroad() { osmTagMapper.populateProperties(wps); var way = WayTestData.carTunnel(); assertEquals(ALL, wps.getDataForWay(way).getPermission()); - way.addTag("motorroad","yes"); + way.addTag("motorroad", "yes"); assertEquals(CAR, wps.getDataForWay(way).getPermission()); } } diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java index c5124fbd55a..5448f84294d 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java @@ -6,7 +6,10 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; +import java.util.List; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.opentripplanner.osm.model.OsmWithTags; import org.opentripplanner.osm.wayproperty.WayPropertySet; import org.opentripplanner.osm.wayproperty.specifier.WayTestData; @@ -168,16 +171,26 @@ void testBicyclePermissive() { assertTrue(osmTagMapper.isWalkThroughTrafficExplicitlyDisallowed(tags)); } - @Test - void motorroad() { + public static List roadCases() { + return List.of( + WayTestData.carTunnel(), + WayTestData.southwestMayoStreet(), + WayTestData.southeastLaBonitaWay(), + WayTestData.fiveLanes(), + WayTestData.highwayTertiary() + ); + } + + @ParameterizedTest + @MethodSource("roadCases") + void motorroad(OsmWithTags way) { OsmTagMapper osmTagMapper = new OsmTagMapper(); WayPropertySet wps = new WayPropertySet(); osmTagMapper.populateProperties(wps); - var way = WayTestData.carTunnel(); assertEquals(ALL, wps.getDataForWay(way).getPermission()); - way.addTag("motorroad","yes"); + way.addTag("motorroad", "yes"); assertEquals(CAR, wps.getDataForWay(way).getPermission()); } From 669d71f53102b629a2d33ce2544481cf04ce1d24 Mon Sep 17 00:00:00 2001 From: OTP Serialization Version Bot Date: Thu, 28 Nov 2024 11:53:30 +0000 Subject: [PATCH 41/55] Bump serialization version id for #6246 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b42ab78d978..2bc204d7c05 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 172 + 173 32.0 2.52 From dee1a4762e88f9e706b1167eaee4a7e36730a4bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:53:53 +0000 Subject: [PATCH 42/55] fix(deps): update dependency com.fasterxml.jackson.datatype:jackson-datatype-jdk8 to v2.18.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b42ab78d978..100d489a84a 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 32.0 2.52 - 2.18.1 + 2.18.2 3.1.9 5.11.3 1.13.7 From ace254e3c48b2035d1b45aedb4dd27dbd6b48cb8 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Nov 2024 14:00:10 +0100 Subject: [PATCH 43/55] Update renovate rules for jackson, dagger [ci skip] --- renovate.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index b46a098392a..d34b8573649 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -145,8 +145,8 @@ { "description": "give some projects time to publish a changelog before opening the PR", "matchPackageNames": [ - "com.google.dagger:", - "com.fasterxml.jackson" + "com.google.dagger:{/,}**", + "com.fasterxml.jackson:{/,}**" ], "minimumReleaseAge": "1 week" }, From db171d254e2b4b5b9576037830e6a9e76310de96 Mon Sep 17 00:00:00 2001 From: Eivind Morris Bakke Date: Thu, 28 Nov 2024 16:04:17 +0100 Subject: [PATCH 44/55] Add a matcher API for filters in the transit service used for serviceJourney lookup (#6207) * Removes some unused functions from TransitService and TripOnServiceDate * Adds filtering logic to the serviceJourneys Transmodel GraphQL query. * Fixes a typo that carried over from a documentation copy. * Resolving merge conflict. * Addresses comments in review - updates naming to reflect clear division between netex and OTP internals. * Applies formatting. * Fixes formatting and some residual merge issues. * Addresses comments in PR. Importantly this creates the CriteriaCollection type which allows for checking features about collections of criteria independently of the collection type. * Applies results from prettier to CriteriaCollectionTest. * Addresses comments from review. Adds formatting to API and md documentation, and adds an exception thrown for invalid calls to values in CriteriaCollection. * Renames methods in CriteriaCollection as discussed in code review. * Addresses comments from code review. * Changes name of CriteriaCollection to FilterValueCollection. * Adds documentation to clarify usage and intent of the FilterValueCollection. * Fixes potential null values in request builders and exception throwing in get() method. * Addresses comments from code review. * Changes name of FilterValueCollection to FilterValues. * Creates the RequiredFilterValues and FilterValuesEmptyIsEverything subclasses of the now abstract FilterValues class. * Apply suggestions from code review Co-authored-by: Thomas Gran * Addresses comments from code review. * Makes a method name change. * asserts that exception strings in the RequiredFilterValuesTest are as expected. * Fixes some issues left over from resolving merge conflicts. --------- Co-authored-by: Thomas Gran --- .../transmodel/TransmodelGraphQLSchema.java | 64 ++++--- .../timetable/DatedServiceJourneyQuery.java | 47 ++++-- .../transit/api/model/FilterValues.java | 86 ++++++++++ .../model/FilterValuesEmptyIsEverything.java | 19 +++ .../api/model/RequiredFilterValues.java | 24 +++ .../api/request/TripOnServiceDateRequest.java | 82 +++++---- .../TripOnServiceDateRequestBuilder.java | 70 +++++--- .../transit/api/request/TripRequest.java | 51 ++++++ .../api/request/TripRequestBuilder.java | 51 ++++++ .../model/filter/expr/ContainsMatcher.java | 2 +- .../model/filter/expr/ExpressionBuilder.java | 11 +- .../filter/transit/TripMatcherFactory.java | 75 +++++++++ .../TripOnServiceDateMatcherFactory.java | 36 ++-- .../model/timetable/TripOnServiceDate.java | 4 - .../service/DefaultTransitService.java | 28 ++-- .../transit/service/TransitService.java | 14 +- .../apis/transmodel/schema.graphql | 10 +- .../FilterValuesEmptyIsEverythingTest.java | 22 +++ .../api/model/RequiredFilterValuesTest.java | 32 ++++ .../transit/TripMatcherFactoryTest.java | 157 ++++++++++++++++++ .../TripOnServiceDateMatcherFactoryTest.java | 71 +++++--- doc/dev/decisionrecords/NamingConventions.md | 11 ++ 22 files changed, 783 insertions(+), 184 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/transit/api/model/FilterValues.java create mode 100644 application/src/main/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverything.java create mode 100644 application/src/main/java/org/opentripplanner/transit/api/model/RequiredFilterValues.java create mode 100644 application/src/main/java/org/opentripplanner/transit/api/request/TripRequest.java create mode 100644 application/src/main/java/org/opentripplanner/transit/api/request/TripRequestBuilder.java create mode 100644 application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactory.java create mode 100644 application/src/test/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverythingTest.java create mode 100644 application/src/test/java/org/opentripplanner/transit/api/model/RequiredFilterValuesTest.java create mode 100644 application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactoryTest.java diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java index 1a62ef7f5b1..922f9f5244b 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java @@ -114,6 +114,8 @@ import org.opentripplanner.routing.graphfinder.PlaceAtDistance; import org.opentripplanner.routing.graphfinder.PlaceType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.api.request.TripRequest; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.Route; @@ -1261,14 +1263,14 @@ private GraphQLSchema create() { GraphQLFieldDefinition .newFieldDefinition() .name("serviceJourneys") - .description("Get all service journeys") + .description("Get all _service journeys_") .withDirective(TransmodelDirectives.TIMING_DATA) .type(new GraphQLNonNull(new GraphQLList(serviceJourneyType))) .argument( GraphQLArgument .newArgument() .name("lines") - .description("Set of ids of lines to fetch serviceJourneys for.") + .description("Set of ids of _lines_ to fetch _service journeys_ for.") .type(new GraphQLList(Scalars.GraphQLID)) .build() ) @@ -1276,7 +1278,7 @@ private GraphQLSchema create() { GraphQLArgument .newArgument() .name("privateCodes") - .description("Set of ids of private codes to fetch serviceJourneys for.") + .description("Set of ids of _private codes_ to fetch _service journeys_ for.") .type(new GraphQLList(Scalars.GraphQLString)) .build() ) @@ -1284,7 +1286,7 @@ private GraphQLSchema create() { GraphQLArgument .newArgument() .name("activeDates") - .description("Set of ids of active dates to fetch serviceJourneys for.") + .description("Set of _operating days_ to fetch _service journeys_ for.") .type(new GraphQLList(TransmodelScalars.DATE_SCALAR)) .build() ) @@ -1292,45 +1294,37 @@ private GraphQLSchema create() { GraphQLArgument .newArgument() .name("authorities") - .description("Set of ids of authorities to fetch serviceJourneys for.") + .description("Set of ids of _authorities_ to fetch _service journeys_ for.") .type(new GraphQLList(Scalars.GraphQLString)) .build() ) .dataFetcher(environment -> { - List lineIds = mapIDsToDomainNullSafe( - environment.getArgumentOrDefault("lines", List.of()) + var authorities = FilterValues.ofEmptyIsEverything( + "authorities", + mapIDsToDomainNullSafe(environment.getArgument("authorities")) ); - List privateCodes = environment.getArgumentOrDefault("privateCodes", List.of()); - List activeServiceDates = environment.getArgumentOrDefault( + var lineIds = FilterValues.ofEmptyIsEverything( + "lines", + mapIDsToDomainNullSafe(environment.getArgument("lines")) + ); + var privateCodes = FilterValues.ofEmptyIsEverything( + "privateCodes", + environment.>getArgument("privateCodes") + ); + var activeServiceDates = FilterValues.ofEmptyIsEverything( "activeDates", - List.of() + environment.>getArgument("activeDates") ); - // TODO OTP2 - Use FeedScoped ID - List authorities = environment.getArgumentOrDefault("authorities", List.of()); - TransitService transitService = GqlUtil.getTransitService(environment); - return transitService - .listTrips() - .stream() - .filter(t -> lineIds.isEmpty() || lineIds.contains(t.getRoute().getId())) - .filter(t -> - privateCodes.isEmpty() || privateCodes.contains(t.getNetexInternalPlanningCode()) - ) - .filter(t -> - authorities.isEmpty() || - authorities.contains(t.getRoute().getAgency().getId().getId()) - ) - .filter(t -> - ( - activeServiceDates.isEmpty() || - transitService - .getCalendarService() - .getServiceDatesForServiceId(t.getServiceId()) - .stream() - .anyMatch(activeServiceDates::contains) - ) - ) - .collect(Collectors.toList()); + TripRequest tripRequest = TripRequest + .of() + .withAgencies(authorities) + .withRoutes(lineIds) + .withNetexInternalPlanningCodes(privateCodes) + .withServiceDates(activeServiceDates) + .build(); + + return GqlUtil.getTransitService(environment).getTrips(tripRequest); }) .build() ) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java index 56267c6992d..2d381140b73 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/DatedServiceJourneyQuery.java @@ -14,6 +14,7 @@ import org.opentripplanner.apis.transmodel.model.EnumTypes; import org.opentripplanner.apis.transmodel.model.framework.TransmodelScalars; import org.opentripplanner.apis.transmodel.support.GqlUtil; +import org.opentripplanner.transit.api.model.FilterValues; import org.opentripplanner.transit.api.request.TripOnServiceDateRequest; import org.opentripplanner.transit.api.request.TripOnServiceDateRequestBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -94,26 +95,46 @@ public static GraphQLFieldDefinition createQuery(GraphQLOutputType datedServiceJ ) .dataFetcher(environment -> { // The null safety checks are not needed here - they are taken care of by the request - // object, but reuse let's use the mapping method and leave this improvement until all APIs + // object, but let's use the mapping method and leave this improvement until all APIs // are pushing this check into the domain request. - var authorities = mapIDsToDomainNullSafe(environment.getArgument("authorities")); - var lines = mapIDsToDomainNullSafe(environment.getArgument("lines")); - var serviceJourneys = mapIDsToDomainNullSafe(environment.getArgument("serviceJourneys")); - var replacementFor = mapIDsToDomainNullSafe(environment.getArgument("replacementFor")); - var privateCodes = environment.>getArgument("privateCodes"); - var operatingDays = environment.>getArgument("operatingDays"); - var alterations = environment.>getArgument("alterations"); + var authorities = FilterValues.ofEmptyIsEverything( + "authorities", + mapIDsToDomainNullSafe(environment.getArgument("authorities")) + ); + var lines = FilterValues.ofEmptyIsEverything( + "lines", + mapIDsToDomainNullSafe(environment.getArgument("lines")) + ); + var serviceJourneys = FilterValues.ofEmptyIsEverything( + "serviceJourneys", + mapIDsToDomainNullSafe(environment.getArgument("serviceJourneys")) + ); + var replacementFor = FilterValues.ofEmptyIsEverything( + "replacementFor", + mapIDsToDomainNullSafe(environment.getArgument("replacementFor")) + ); + var privateCodes = FilterValues.ofEmptyIsEverything( + "privateCodes", + environment.>getArgument("privateCodes") + ); + var operatingDays = FilterValues.ofRequired( + "operatingDays", + environment.>getArgument("operatingDays") + ); + var alterations = FilterValues.ofEmptyIsEverything( + "alterations", + environment.>getArgument("alterations") + ); TripOnServiceDateRequestBuilder tripOnServiceDateRequestBuilder = TripOnServiceDateRequest - .of() - .withOperatingDays(operatingDays) - .withAuthorities(authorities) - .withLines(lines) + .of(operatingDays) + .withAgencies(authorities) + .withRoutes(lines) .withServiceJourneys(serviceJourneys) .withReplacementFor(replacementFor); tripOnServiceDateRequestBuilder = - tripOnServiceDateRequestBuilder.withPrivateCodes(privateCodes); + tripOnServiceDateRequestBuilder.withNetexInternalPlanningCodes(privateCodes); tripOnServiceDateRequestBuilder = tripOnServiceDateRequestBuilder.withAlterations(alterations); diff --git a/application/src/main/java/org/opentripplanner/transit/api/model/FilterValues.java b/application/src/main/java/org/opentripplanner/transit/api/model/FilterValues.java new file mode 100644 index 00000000000..391b2531231 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/api/model/FilterValues.java @@ -0,0 +1,86 @@ +package org.opentripplanner.transit.api.model; + +import com.beust.jcommander.internal.Nullable; +import java.util.Collection; +import java.util.NoSuchElementException; +import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.service.TransitService; + +/** + * {@link FilterValues} is meant to be used when filtering results from {@link TransitService}. + *

+ * This abstraction over the Collection type lets us keep filter specific functionality separate + * from interpretation of various states of a collection. For instance in which case the filter values + * should match all entities they are meant to filter. + *

+ * @param - The type of the filter values. Typically, String or {@link FeedScopedId}. + */ +public abstract class FilterValues { + + @Nullable + protected final Collection values; + + private final String name; + + FilterValues(String name, @Nullable Collection values) { + this.name = name; + this.values = values; + } + + /** + * Returns a {@link FilterValues} that matches everything if there are no filter values. + *

+ * @param name - The name of the filter. + * @param - The type of the filter values. Typically, String or {@link FeedScopedId}. + * @param values - The {@link Collection} of filter values. + * @return FilterValues + */ + public static FilterValues ofEmptyIsEverything( + String name, + @Nullable Collection values + ) { + return new FilterValuesEmptyIsEverything<>(name, values); + } + + /** + * Returns a {@link RequiredFilterValues} that throws an exception at creation time if the filter + * values is null or empty. + *

+ * @param name - The name of the filter. + * @param - The type of the filter values. Typically, String or {@link FeedScopedId}. + * @param values - The {@link Collection} of filter values. + * @return RequiredFilterValues + */ + public static RequiredFilterValues ofRequired( + String name, + @Nullable Collection values + ) { + return new RequiredFilterValues<>(name, values); + } + + /** + * Returns True if the collection of filter values matches everything that it could filter. If this + * is the case, then the filter values should not be used to filter anything and filtering logic can + * safely ignore it. + *

+ * @return boolean + */ + public abstract boolean includeEverything(); + + /** + * Returns the collection of filter values. If the filter values effectively don't filter anything, + * an exception is thrown. + *

+ * @return Collection - The values of the filter. + */ + public Collection get() { + if (includeEverything()) { + throw new NoSuchElementException( + "Filter values for filter %s effectively don't filter, use includeEverything() before calling this method.".formatted( + name + ) + ); + } + return values; + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverything.java b/application/src/main/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverything.java new file mode 100644 index 00000000000..ebe0af7bccb --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverything.java @@ -0,0 +1,19 @@ +package org.opentripplanner.transit.api.model; + +import java.util.Collection; + +/** + * {@link FilterValuesEmptyIsEverything} is a subclass of {@link FilterValues} that includes + * everything if the values are null or empty. + */ +public class FilterValuesEmptyIsEverything extends FilterValues { + + FilterValuesEmptyIsEverything(String name, Collection values) { + super(name, values); + } + + @Override + public boolean includeEverything() { + return values == null || values.isEmpty(); + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/api/model/RequiredFilterValues.java b/application/src/main/java/org/opentripplanner/transit/api/model/RequiredFilterValues.java new file mode 100644 index 00000000000..f4456dcce75 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/api/model/RequiredFilterValues.java @@ -0,0 +1,24 @@ +package org.opentripplanner.transit.api.model; + +import java.util.Collection; + +/** + * {@link RequiredFilterValues} is a subclass of {@link FilterValues} that requires at least one + * value to be included. + */ +public class RequiredFilterValues extends FilterValues { + + RequiredFilterValues(String name, Collection values) { + super(name, values); + if (values == null || values.isEmpty()) { + throw new IllegalArgumentException("Filter %s values must not be empty.".formatted(name)); + } + } + + @Override + public boolean includeEverything() { + // RequiredFilterValues should never include everything. In theory the filter values could be + // exhaustive, but there is no check for that currently. + return false; + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java index adc7283ee4d..c61bb8ad107 100644 --- a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java +++ b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java @@ -1,77 +1,75 @@ package org.opentripplanner.transit.api.request; import java.time.LocalDate; -import java.util.List; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.api.model.RequiredFilterValues; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.timetable.TripAlteration; -import org.opentripplanner.utils.collection.ListUtils; +import org.opentripplanner.transit.model.timetable.TripOnServiceDate; -/* +/** * A request for trips on a specific service date. - * - * This request is used to retrieve TripsOnServiceDates that match the provided criteria. + *

+ * This request is used to retrieve {@link TripOnServiceDate}s that match the provided filter values. * At least one operatingDay must be provided. */ public class TripOnServiceDateRequest { - private final List operatingDays; - private final List authorities; - private final List lines; - private final List serviceJourneys; - private final List replacementFor; - private final List privateCodes; - private final List alterations; + private final FilterValues serviceDates; + private final FilterValues agencies; + private final FilterValues routes; + private final FilterValues serviceJourneys; + private final FilterValues replacementFor; + private final FilterValues netexInternalPlanningCodes; + private final FilterValues alterations; protected TripOnServiceDateRequest( - List operatingDays, - List authorities, - List lines, - List serviceJourneys, - List replacementFor, - List privateCodes, - List alterations + RequiredFilterValues serviceDates, + FilterValues agencies, + FilterValues routes, + FilterValues serviceJourneys, + FilterValues replacementFor, + FilterValues netexInternalPlanningCodes, + FilterValues alterations ) { - if (operatingDays == null || operatingDays.isEmpty()) { - throw new IllegalArgumentException("operatingDays must have at least one date"); - } - this.operatingDays = ListUtils.nullSafeImmutableList(operatingDays); - this.authorities = ListUtils.nullSafeImmutableList(authorities); - this.lines = ListUtils.nullSafeImmutableList(lines); - this.serviceJourneys = ListUtils.nullSafeImmutableList(serviceJourneys); - this.replacementFor = ListUtils.nullSafeImmutableList(replacementFor); - this.privateCodes = ListUtils.nullSafeImmutableList(privateCodes); - this.alterations = ListUtils.nullSafeImmutableList(alterations); + this.serviceDates = serviceDates; + this.agencies = agencies; + this.routes = routes; + this.serviceJourneys = serviceJourneys; + this.replacementFor = replacementFor; + this.netexInternalPlanningCodes = netexInternalPlanningCodes; + this.alterations = alterations; } - public static TripOnServiceDateRequestBuilder of() { - return new TripOnServiceDateRequestBuilder(); + public static TripOnServiceDateRequestBuilder of(RequiredFilterValues serviceDates) { + return new TripOnServiceDateRequestBuilder(serviceDates); } - public List authorities() { - return authorities; + public FilterValues agencies() { + return agencies; } - public List lines() { - return lines; + public FilterValues routes() { + return routes; } - public List serviceJourneys() { + public FilterValues serviceJourneys() { return serviceJourneys; } - public List replacementFor() { + public FilterValues replacementFor() { return replacementFor; } - public List privateCodes() { - return privateCodes; + public FilterValues netexInternalPlanningCodes() { + return netexInternalPlanningCodes; } - public List alterations() { + public FilterValues alterations() { return alterations; } - public List operatingDays() { - return operatingDays; + public FilterValues serviceDates() { + return serviceDates; } } diff --git a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequestBuilder.java b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequestBuilder.java index 7aa2644fdc9..534557c15d8 100644 --- a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequestBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequestBuilder.java @@ -2,64 +2,84 @@ import java.time.LocalDate; import java.util.List; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.api.model.RequiredFilterValues; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.timetable.TripAlteration; public class TripOnServiceDateRequestBuilder { - private List authorities; - private List lines; - private List serviceJourneys; - private List replacementFor; - private List privateCodes; - private List alterations; - private List operatingDays; + private FilterValues agencies = FilterValues.ofEmptyIsEverything( + "agencies", + List.of() + ); + private FilterValues routes = FilterValues.ofEmptyIsEverything("routes", List.of()); + private FilterValues serviceJourneys = FilterValues.ofEmptyIsEverything( + "serviceJourneys", + List.of() + ); + private FilterValues replacementFor = FilterValues.ofEmptyIsEverything( + "replacementFor", + List.of() + ); + private FilterValues netexInternalPlanningCodes = FilterValues.ofEmptyIsEverything( + "netexInternalPlanningCodes", + List.of() + ); + private FilterValues alterations = FilterValues.ofEmptyIsEverything( + "alterations", + List.of() + ); + private RequiredFilterValues serviceDates; - protected TripOnServiceDateRequestBuilder() {} - - public TripOnServiceDateRequestBuilder withOperatingDays(List operatingDays) { - this.operatingDays = operatingDays; - return this; + protected TripOnServiceDateRequestBuilder(RequiredFilterValues serviceDates) { + this.serviceDates = serviceDates; } - public TripOnServiceDateRequestBuilder withAuthorities(List authorities) { - this.authorities = authorities; + public TripOnServiceDateRequestBuilder withAgencies(FilterValues agencies) { + this.agencies = agencies; return this; } - public TripOnServiceDateRequestBuilder withLines(List lines) { - this.lines = lines; + public TripOnServiceDateRequestBuilder withRoutes(FilterValues routes) { + this.routes = routes; return this; } - public TripOnServiceDateRequestBuilder withServiceJourneys(List serviceJourneys) { + public TripOnServiceDateRequestBuilder withServiceJourneys( + FilterValues serviceJourneys + ) { this.serviceJourneys = serviceJourneys; return this; } - public TripOnServiceDateRequestBuilder withReplacementFor(List replacementFor) { + public TripOnServiceDateRequestBuilder withReplacementFor( + FilterValues replacementFor + ) { this.replacementFor = replacementFor; return this; } - public TripOnServiceDateRequestBuilder withPrivateCodes(List privateCodes) { - this.privateCodes = privateCodes; + public TripOnServiceDateRequestBuilder withNetexInternalPlanningCodes( + FilterValues netexInternalPlanningCodes + ) { + this.netexInternalPlanningCodes = netexInternalPlanningCodes; return this; } - public TripOnServiceDateRequestBuilder withAlterations(List alterations) { + public TripOnServiceDateRequestBuilder withAlterations(FilterValues alterations) { this.alterations = alterations; return this; } public TripOnServiceDateRequest build() { return new TripOnServiceDateRequest( - operatingDays, - authorities, - lines, + serviceDates, + agencies, + routes, serviceJourneys, replacementFor, - privateCodes, + netexInternalPlanningCodes, alterations ); } diff --git a/application/src/main/java/org/opentripplanner/transit/api/request/TripRequest.java b/application/src/main/java/org/opentripplanner/transit/api/request/TripRequest.java new file mode 100644 index 00000000000..c73e800582b --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/api/request/TripRequest.java @@ -0,0 +1,51 @@ +package org.opentripplanner.transit.api.request; + +import java.time.LocalDate; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.model.timetable.Trip; + +/** + * A request for {@link Trip}s. + *

+ * This request is used to retrieve {@link Trip}s that match the provided filter values. + */ +public class TripRequest { + + private final FilterValues agencies; + private final FilterValues routes; + private final FilterValues netexInternalPlanningCodes; + private final FilterValues serviceDates; + + protected TripRequest( + FilterValues agencies, + FilterValues routes, + FilterValues netexInternalPlanningCodes, + FilterValues serviceDates + ) { + this.agencies = agencies; + this.routes = routes; + this.netexInternalPlanningCodes = netexInternalPlanningCodes; + this.serviceDates = serviceDates; + } + + public static TripRequestBuilder of() { + return new TripRequestBuilder(); + } + + public FilterValues agencies() { + return agencies; + } + + public FilterValues routes() { + return routes; + } + + public FilterValues netexInternalPlanningCodes() { + return netexInternalPlanningCodes; + } + + public FilterValues serviceDates() { + return serviceDates; + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/api/request/TripRequestBuilder.java b/application/src/main/java/org/opentripplanner/transit/api/request/TripRequestBuilder.java new file mode 100644 index 00000000000..3a2f80a3e34 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/api/request/TripRequestBuilder.java @@ -0,0 +1,51 @@ +package org.opentripplanner.transit.api.request; + +import java.time.LocalDate; +import java.util.List; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.model.framework.FeedScopedId; + +public class TripRequestBuilder { + + private FilterValues agencies = FilterValues.ofEmptyIsEverything( + "agencies", + List.of() + ); + private FilterValues routes = FilterValues.ofEmptyIsEverything("routes", List.of()); + private FilterValues netexInternalPlanningCodes = FilterValues.ofEmptyIsEverything( + "netexInternalPlanningCodes", + List.of() + ); + private FilterValues serviceDates = FilterValues.ofEmptyIsEverything( + "serviceDates", + List.of() + ); + + protected TripRequestBuilder() {} + + public TripRequestBuilder withAgencies(FilterValues agencies) { + this.agencies = agencies; + return this; + } + + public TripRequestBuilder withRoutes(FilterValues routes) { + this.routes = routes; + return this; + } + + public TripRequestBuilder withNetexInternalPlanningCodes( + FilterValues netexInternalPlanningCodes + ) { + this.netexInternalPlanningCodes = netexInternalPlanningCodes; + return this; + } + + public TripRequestBuilder withServiceDates(FilterValues serviceDates) { + this.serviceDates = serviceDates; + return this; + } + + public TripRequest build() { + return new TripRequest(agencies, routes, netexInternalPlanningCodes, serviceDates); + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ContainsMatcher.java b/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ContainsMatcher.java index ed3731897ec..1be81ba9e7f 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ContainsMatcher.java +++ b/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ContainsMatcher.java @@ -50,6 +50,6 @@ public boolean match(S entity) { @Override public String toString() { - return "ContainsMatcher: " + relationshipName + ": " + valueMatcher.toString(); + return "ContainsMatcher: " + relationshipName + ": " + valueMatcher; } } diff --git a/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ExpressionBuilder.java b/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ExpressionBuilder.java index b1b4d5be322..f2910a4c8d2 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ExpressionBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/model/filter/expr/ExpressionBuilder.java @@ -1,9 +1,9 @@ package org.opentripplanner.transit.model.filter.expr; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.function.Function; +import org.opentripplanner.transit.api.model.FilterValues; /** * A builder for creating complex matchers composed of other matchers. @@ -22,12 +22,15 @@ public static ExpressionBuilder of() { return new ExpressionBuilder<>(); } - public ExpressionBuilder or(Collection values, Function> valueProvider) { - if (values.isEmpty()) { + public ExpressionBuilder atLeastOneMatch( + FilterValues filterValues, + Function> matcherProvider + ) { + if (filterValues.includeEverything()) { return this; } - matchers.add(OrMatcher.of(values.stream().map(valueProvider).toList())); + matchers.add(OrMatcher.of(filterValues.get().stream().map(matcherProvider).toList())); return this; } diff --git a/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactory.java b/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactory.java new file mode 100644 index 00000000000..1ff33d9928d --- /dev/null +++ b/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactory.java @@ -0,0 +1,75 @@ +package org.opentripplanner.transit.model.filter.transit; + +import java.time.LocalDate; +import java.util.Set; +import java.util.function.Function; +import org.opentripplanner.transit.api.request.TripRequest; +import org.opentripplanner.transit.model.filter.expr.ContainsMatcher; +import org.opentripplanner.transit.model.filter.expr.EqualityMatcher; +import org.opentripplanner.transit.model.filter.expr.ExpressionBuilder; +import org.opentripplanner.transit.model.filter.expr.Matcher; +import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.model.timetable.Trip; + +/** + * A factory for creating matchers for {@link Trip} objects. + *

+ * This factory is used to create matchers for {@link Trip} objects based on a request. The + * resulting matcher can be used to filter a list of {@link Trip} objects. + */ +public class TripMatcherFactory { + + /** + * Creates a matcher for {@link Trip} objects based on the given request. + * + * @param request - a {@link TripRequest} object that contains the criteria for the matcher. + * @param serviceDateProvider a function that provides the service dates for a given {@link FeedScopedId} of a {@link Trip}. + * @return a {@link Matcher} to be used for filtering {@link Trip} objects. + */ + public static Matcher of( + TripRequest request, + Function> serviceDateProvider + ) { + ExpressionBuilder expr = ExpressionBuilder.of(); + + expr.atLeastOneMatch(request.agencies(), TripMatcherFactory::agencyId); + expr.atLeastOneMatch(request.routes(), TripMatcherFactory::routeId); + expr.atLeastOneMatch( + request.netexInternalPlanningCodes(), + TripMatcherFactory::netexInternalPlanningCode + ); + expr.atLeastOneMatch( + request.serviceDates(), + TripMatcherFactory.serviceDate(serviceDateProvider) + ); + + return expr.build(); + } + + static Matcher agencyId(FeedScopedId id) { + return new EqualityMatcher<>("agency", id, t -> t.getRoute().getAgency().getId()); + } + + static Matcher routeId(FeedScopedId id) { + return new EqualityMatcher<>("route", id, t -> t.getRoute().getId()); + } + + static Matcher netexInternalPlanningCode(String code) { + return new EqualityMatcher<>( + "netexInternalPlanningCode", + code, + Trip::getNetexInternalPlanningCode + ); + } + + static Function> serviceDate( + Function> serviceDateProvider + ) { + return date -> + new ContainsMatcher<>( + "serviceDates", + t -> serviceDateProvider.apply(t.getServiceId()), + new EqualityMatcher<>("serviceDate", date, (dateToMatch -> dateToMatch)) + ); + } +} diff --git a/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactory.java b/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactory.java index f86e7a1ff77..7442e2874eb 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactory.java +++ b/application/src/main/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactory.java @@ -12,27 +12,33 @@ import org.opentripplanner.transit.model.timetable.TripOnServiceDate; /** - * A factory for creating matchers for TripOnServiceDate objects. + * A factory for creating matchers for {@link TripOnServiceDate} objects. *

- * This factory is used to create matchers for TripOnServiceDate objects based on a request. The - * resulting matcher can be used to filter a list of TripOnServiceDate objects. + * This factory is used to create matchers for {@link TripOnServiceDate} objects based on a request. The + * resulting matcher can be used to filter a list of {@link TripOnServiceDate} objects. */ public class TripOnServiceDateMatcherFactory { public static Matcher of(TripOnServiceDateRequest request) { ExpressionBuilder expr = ExpressionBuilder.of(); - expr.or(request.operatingDays(), TripOnServiceDateMatcherFactory::operatingDay); - expr.or(request.authorities(), TripOnServiceDateMatcherFactory::authorityId); - expr.or(request.lines(), TripOnServiceDateMatcherFactory::routeId); - expr.or(request.serviceJourneys(), TripOnServiceDateMatcherFactory::serviceJourneyId); - expr.or(request.replacementFor(), TripOnServiceDateMatcherFactory::replacementFor); - expr.or(request.privateCodes(), TripOnServiceDateMatcherFactory::privateCode); - expr.or(request.alterations(), TripOnServiceDateMatcherFactory::alteration); + expr.atLeastOneMatch(request.serviceDates(), TripOnServiceDateMatcherFactory::serviceDate); + expr.atLeastOneMatch(request.agencies(), TripOnServiceDateMatcherFactory::agencyId); + expr.atLeastOneMatch(request.routes(), TripOnServiceDateMatcherFactory::routeId); + expr.atLeastOneMatch( + request.serviceJourneys(), + TripOnServiceDateMatcherFactory::serviceJourneyId + ); + expr.atLeastOneMatch(request.replacementFor(), TripOnServiceDateMatcherFactory::replacementFor); + expr.atLeastOneMatch( + request.netexInternalPlanningCodes(), + TripOnServiceDateMatcherFactory::netexInternalPlanningCode + ); + expr.atLeastOneMatch(request.alterations(), TripOnServiceDateMatcherFactory::alteration); return expr.build(); } - static Matcher authorityId(FeedScopedId id) { + static Matcher agencyId(FeedScopedId id) { return new EqualityMatcher<>("agency", id, t -> t.getTrip().getRoute().getAgency().getId()); } @@ -52,16 +58,16 @@ static Matcher replacementFor(FeedScopedId id) { ); } - static Matcher privateCode(String code) { + static Matcher netexInternalPlanningCode(String code) { return new EqualityMatcher<>( - "privateCode", + "netexInternalPlanningCode", code, t -> t.getTrip().getNetexInternalPlanningCode() ); } - static Matcher operatingDay(LocalDate date) { - return new EqualityMatcher<>("operatingDay", date, TripOnServiceDate::getServiceDate); + static Matcher serviceDate(LocalDate date) { + return new EqualityMatcher<>("serviceDate", date, TripOnServiceDate::getServiceDate); } static Matcher alteration(TripAlteration alteration) { diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java index ee520f9e0f0..1a22ec70000 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java @@ -45,10 +45,6 @@ public List getReplacementFor() { return replacementFor; } - public TripIdAndServiceDate getTripIdAndServiceDate() { - return new TripIdAndServiceDate(trip.getId(), serviceDate); - } - @Override public boolean sameAs(TripOnServiceDate other) { return ( diff --git a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index 8557ce21440..d35977cae74 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -35,9 +35,11 @@ import org.opentripplanner.routing.stoptimes.ArrivalDeparture; import org.opentripplanner.routing.stoptimes.StopTimesHelper; import org.opentripplanner.transit.api.request.TripOnServiceDateRequest; +import org.opentripplanner.transit.api.request.TripRequest; import org.opentripplanner.transit.model.basic.Notice; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.filter.expr.Matcher; +import org.opentripplanner.transit.model.filter.transit.TripMatcherFactory; import org.opentripplanner.transit.model.filter.transit.TripOnServiceDateMatcherFactory; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.Deduplicator; @@ -166,11 +168,6 @@ public TIntSet getServiceCodesRunningForDate(LocalDate serviceDate) { .getOrDefault(serviceDate, new TIntHashSet()); } - @Override - public AreaStop getAreaStop(FeedScopedId id) { - return this.timetableRepository.getSiteRepository().getAreaStop(id); - } - @Override public Agency getAgency(FeedScopedId id) { return this.timetableRepositoryIndex.getAgencyForId(id); @@ -231,12 +228,6 @@ public Collection listStopLocations() { return timetableRepository.getSiteRepository().listStopLocations(); } - @Override - public Collection listRegularStops() { - OTPRequestTimeoutException.checkForTimeout(); - return timetableRepository.getSiteRepository().listRegularStops(); - } - @Override public Collection listGroupStops() { OTPRequestTimeoutException.checkForTimeout(); @@ -594,6 +585,21 @@ public boolean containsTrip(FeedScopedId id) { return this.timetableRepositoryIndex.containsTrip(id); } + /** + * Returns a list of Trips that match the filtering defined in the request. + * + * @param request - A TripRequest object with filtering defined. + * @return - A list Trips + */ + @Override + public List getTrips(TripRequest request) { + Matcher matcher = TripMatcherFactory.of( + request, + this.getCalendarService()::getServiceDatesForServiceId + ); + return listTrips().stream().filter(matcher::match).toList(); + } + /** * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix * this when doing the issue #3030. diff --git a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java index 863035950eb..c1bba355cdf 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TransitService.java @@ -25,6 +25,7 @@ import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.routing.stoptimes.ArrivalDeparture; import org.opentripplanner.transit.api.request.TripOnServiceDateRequest; +import org.opentripplanner.transit.api.request.TripRequest; import org.opentripplanner.transit.model.basic.Notice; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; @@ -128,8 +129,6 @@ public interface TransitService { Collection listStopLocations(); - Collection listRegularStops(); - Collection listGroupStops(); StopLocation getStopLocation(FeedScopedId parseId); @@ -146,9 +145,6 @@ public interface TransitService { StopLocationsGroup getStopLocationsGroup(FeedScopedId id); - @Nullable - AreaStop getAreaStop(FeedScopedId id); - /** * Return the trip for the given id, including trips created in real time. */ @@ -313,6 +309,14 @@ List findTripTimeOnDate( */ List findTripsOnServiceDate(TripOnServiceDateRequest request); + /** + * Returns a list of Trips that match the filtering defined in the request. + * + * @param request - A TripRequest object with filtering defined. + * @return - A list of Trips + */ + List getTrips(TripRequest request); + /** * Checks if a trip with the given ID exists in the model. * diff --git a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql index ed182473bb6..783cc3e7948 100644 --- a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql +++ b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql @@ -734,15 +734,15 @@ type QueryType { serverInfo: ServerInfo! @timingData "Get a single service journey based on its id" serviceJourney(id: String!): ServiceJourney @timingData - "Get all service journeys" + "Get all _service journeys_" serviceJourneys( - "Set of ids of active dates to fetch serviceJourneys for." + "Set of _operating days_ to fetch _service journeys_ for." activeDates: [Date], - "Set of ids of authorities to fetch serviceJourneys for." + "Set of ids of _authorities_ to fetch _service journeys_ for." authorities: [String], - "Set of ids of lines to fetch serviceJourneys for." + "Set of ids of _lines_ to fetch _service journeys_ for." lines: [ID], - "Set of ids of private codes to fetch serviceJourneys for." + "Set of ids of _private codes_ to fetch _service journeys_ for." privateCodes: [String] ): [ServiceJourney]! @timingData "Get a single situation based on its situationNumber" diff --git a/application/src/test/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverythingTest.java b/application/src/test/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverythingTest.java new file mode 100644 index 00000000000..95e8f2ca292 --- /dev/null +++ b/application/src/test/java/org/opentripplanner/transit/api/model/FilterValuesEmptyIsEverythingTest.java @@ -0,0 +1,22 @@ +package org.opentripplanner.transit.api.model; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.List; +import org.junit.jupiter.api.Test; + +public class FilterValuesEmptyIsEverythingTest { + + @Test + void testEmptyIncludeEverything() { + FilterValues filterValues = FilterValues.ofEmptyIsEverything("null", List.of()); + assertTrue(filterValues.includeEverything()); + } + + @Test + void testNullIncludeEverything() { + List nullList = null; + FilterValues filterValues2 = FilterValues.ofEmptyIsEverything("null", nullList); + assertTrue(filterValues2.includeEverything()); + } +} diff --git a/application/src/test/java/org/opentripplanner/transit/api/model/RequiredFilterValuesTest.java b/application/src/test/java/org/opentripplanner/transit/api/model/RequiredFilterValuesTest.java new file mode 100644 index 00000000000..7c06128c7bf --- /dev/null +++ b/application/src/test/java/org/opentripplanner/transit/api/model/RequiredFilterValuesTest.java @@ -0,0 +1,32 @@ +package org.opentripplanner.transit.api.model; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import org.junit.jupiter.api.Test; + +class RequiredFilterValuesTest { + + @Test + void testEmptyIsInvalid() { + IllegalArgumentException e = assertThrows( + IllegalArgumentException.class, + () -> { + FilterValues.ofRequired("empty", List.of()); + } + ); + assertEquals("Filter empty values must not be empty.", e.getMessage()); + } + + @Test + void testNullIsInvalid() { + List nullList = null; + IllegalArgumentException e = assertThrows( + IllegalArgumentException.class, + () -> { + FilterValues.ofRequired("null", nullList); + } + ); + assertEquals("Filter null values must not be empty.", e.getMessage()); + } +} diff --git a/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactoryTest.java b/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactoryTest.java new file mode 100644 index 00000000000..ec4b3241dd5 --- /dev/null +++ b/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactoryTest.java @@ -0,0 +1,157 @@ +package org.opentripplanner.transit.model.filter.transit; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDate; +import java.util.List; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.opentripplanner.transit.api.model.FilterValues; +import org.opentripplanner.transit.api.request.TripRequest; +import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.transit.model.filter.expr.Matcher; +import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.transit.model.organization.Agency; +import org.opentripplanner.transit.model.timetable.Trip; + +public class TripMatcherFactoryTest { + + private Trip tripRut; + private Trip tripRut2; + private Trip tripAkt; + + @BeforeEach + void setup() { + tripRut = + Trip + .of(new FeedScopedId("F", "RUT:route:trip:1")) + .withRoute( + Route + .of(new FeedScopedId("F", "RUT:route:1")) + .withAgency( + Agency + .of(new FeedScopedId("F", "RUT:1")) + .withName("RUT") + .withTimezone("Europe/Oslo") + .build() + ) + .withMode(TransitMode.BUS) + .withShortName("BUS") + .build() + ) + .withServiceId(new FeedScopedId("F", "RUT:route:trip:1")) + .build(); + tripRut2 = + Trip + .of(new FeedScopedId("F", "RUT:route:trip:2")) + .withRoute( + Route + .of(new FeedScopedId("F", "RUT:route:2")) + .withAgency( + Agency + .of(new FeedScopedId("F", "RUT:2")) + .withName("RUT") + .withTimezone("Europe/Oslo") + .build() + ) + .withMode(TransitMode.BUS) + .withShortName("BUS") + .build() + ) + .withServiceId(new FeedScopedId("F", "RUT:route:trip:2")) + .build(); + tripAkt = + Trip + .of(new FeedScopedId("F", "AKT:route:trip:1")) + .withRoute( + Route + .of(new FeedScopedId("F", "AKT:route:1")) + .withAgency( + Agency + .of(new FeedScopedId("F", "AKT")) + .withName("AKT") + .withTimezone("Europe/Oslo") + .build() + ) + .withMode(TransitMode.BUS) + .withShortName("BUS") + .build() + ) + .withServiceId(new FeedScopedId("F", "AKT:route:trip:1")) + .build(); + } + + @Test + void testMatchRouteId() { + TripRequest request = TripRequest + .of() + .withRoutes( + FilterValues.ofEmptyIsEverything("routes", List.of(new FeedScopedId("F", "RUT:route:1"))) + ) + .build(); + + Matcher matcher = TripMatcherFactory.of(request, feedScopedId -> Set.of()); + + assertTrue(matcher.match(tripRut)); + assertFalse(matcher.match(tripRut2)); + assertFalse(matcher.match(tripAkt)); + } + + @Test + void testMatchDefaultAll() { + TripRequest request = TripRequest.of().build(); + + Matcher matcher = TripMatcherFactory.of(request, feedScopedId -> Set.of()); + + assertTrue(matcher.match(tripRut)); + assertTrue(matcher.match(tripRut2)); + assertTrue(matcher.match(tripAkt)); + } + + @Test + void testMatchAgencyId() { + TripRequest request = TripRequest + .of() + .withAgencies( + FilterValues.ofEmptyIsEverything("agencies", List.of(new FeedScopedId("F", "RUT:1"))) + ) + .build(); + + Matcher matcher = TripMatcherFactory.of(request, feedScopedId -> Set.of()); + + assertTrue(matcher.match(tripRut)); + assertFalse(matcher.match(tripRut2)); + assertFalse(matcher.match(tripAkt)); + } + + @Test + void testMatchServiceDates() { + TripRequest request = TripRequest + .of() + .withServiceDates( + FilterValues.ofEmptyIsEverything( + "operatingDays", + List.of(LocalDate.of(2024, 2, 22), LocalDate.of(2024, 2, 23)) + ) + ) + .build(); + + Matcher matcher = TripMatcherFactory.of(request, this::dummyServiceDateProvider); + + assertTrue(matcher.match(tripRut)); + assertTrue(matcher.match(tripRut2)); + assertFalse(matcher.match(tripAkt)); + } + + private Set dummyServiceDateProvider(FeedScopedId feedScopedId) { + if (feedScopedId.equals(new FeedScopedId("F", "RUT:route:trip:1"))) { + return Set.of(LocalDate.of(2024, 2, 22), LocalDate.of(2024, 2, 23)); + } else if (feedScopedId.equals(new FeedScopedId("F", "RUT:route:trip:2"))) { + return Set.of(LocalDate.of(2024, 2, 23)); + } + return Set.of(); + } +} diff --git a/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactoryTest.java b/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactoryTest.java index b7cb7aa6698..dcfb10b5947 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactoryTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/filter/transit/TripOnServiceDateMatcherFactoryTest.java @@ -6,6 +6,7 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.opentripplanner.transit.api.model.FilterValues; import org.opentripplanner.transit.api.request.TripOnServiceDateRequest; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.filter.expr.Matcher; @@ -25,16 +26,16 @@ class TripOnServiceDateMatcherFactoryTest { void setup() { tripOnServiceDateRut = TripOnServiceDate - .of(new FeedScopedId("RUT:route:trip:date", "123")) + .of(new FeedScopedId("F", "RUT:route:trip:date:1")) .withTrip( Trip - .of(new FeedScopedId("RUT:route:trip", "1")) + .of(new FeedScopedId("F", "RUT:route:trip:1")) .withRoute( Route - .of(new FeedScopedId("RUT:route", "2")) + .of(new FeedScopedId("F", "RUT:route:1")) .withAgency( Agency - .of(new FeedScopedId("RUT", "3")) + .of(new FeedScopedId("F", "RUT:1")) .withName("RUT") .withTimezone("Europe/Oslo") .build() @@ -50,16 +51,16 @@ void setup() { tripOnServiceDateRut2 = TripOnServiceDate - .of(new FeedScopedId("RUT:route:trip:date", "123")) + .of(new FeedScopedId("F", "RUT:route:trip:date:2")) .withTrip( Trip - .of(new FeedScopedId("RUT:route:trip2", "1")) + .of(new FeedScopedId("F", "RUT:route:trip:2")) .withRoute( Route - .of(new FeedScopedId("RUT:route", "2")) + .of(new FeedScopedId("F", "RUT:route:2")) .withAgency( Agency - .of(new FeedScopedId("RUT", "3")) + .of(new FeedScopedId("F", "RUT:2")) .withName("RUT") .withTimezone("Europe/Oslo") .build() @@ -75,16 +76,16 @@ void setup() { tripOnServiceDateAkt = TripOnServiceDate - .of(new FeedScopedId("AKT:route:trip:date", "123")) + .of(new FeedScopedId("F", "AKT:route:trip:date:1")) .withTrip( Trip - .of(new FeedScopedId("AKT:route:trip", "1")) + .of(new FeedScopedId("F", "AKT:route:trip:1")) .withRoute( Route - .of(new FeedScopedId("AKT:route", "2")) + .of(new FeedScopedId("F", "AKT:route:1")) .withAgency( Agency - .of(new FeedScopedId("AKT", "3")) + .of(new FeedScopedId("F", "AKT:1")) .withName("AKT") .withTimezone("Europe/Oslo") .build() @@ -102,8 +103,7 @@ void setup() { @Test void testMatchOperatingDays() { TripOnServiceDateRequest request = TripOnServiceDateRequest - .of() - .withOperatingDays(List.of(LocalDate.of(2024, 2, 22))) + .of(FilterValues.ofRequired("serviceDates", List.of(LocalDate.of(2024, 2, 22)))) .build(); Matcher matcher = TripOnServiceDateMatcherFactory.of(request); @@ -116,11 +116,19 @@ void testMatchOperatingDays() { @Test void testMatchMultiple() { TripOnServiceDateRequest request = TripOnServiceDateRequest - .of() - .withOperatingDays(List.of(LocalDate.of(2024, 2, 22))) - .withAuthorities(List.of(new FeedScopedId("RUT", "3"))) - .withLines(List.of(new FeedScopedId("RUT:route", "2"))) - .withServiceJourneys(List.of(new FeedScopedId("RUT:route:trip", "1"))) + .of(FilterValues.ofRequired("serviceDates", List.of(LocalDate.of(2024, 2, 22)))) + .withAgencies( + FilterValues.ofEmptyIsEverything("agencies", List.of(new FeedScopedId("F", "RUT:1"))) + ) + .withRoutes( + FilterValues.ofEmptyIsEverything("routes", List.of(new FeedScopedId("F", "RUT:route:1"))) + ) + .withServiceJourneys( + FilterValues.ofEmptyIsEverything( + "serviceJourneys", + List.of(new FeedScopedId("F", "RUT:route:trip:1")) + ) + ) .build(); Matcher matcher = TripOnServiceDateMatcherFactory.of(request); @@ -133,12 +141,27 @@ void testMatchMultiple() { @Test void testMatchMultipleServiceJourneyMatchers() { TripOnServiceDateRequest request = TripOnServiceDateRequest - .of() - .withOperatingDays(List.of(LocalDate.of(2024, 2, 22))) - .withAuthorities(List.of(new FeedScopedId("RUT", "3"))) - .withLines(List.of(new FeedScopedId("RUT:route", "2"))) + .of(FilterValues.ofRequired("serviceDates", List.of(LocalDate.of(2024, 2, 22)))) + .withAgencies( + FilterValues.ofEmptyIsEverything( + "agencies", + List.of(new FeedScopedId("F", "RUT:1"), new FeedScopedId("F", "RUT:2")) + ) + ) + .withRoutes( + FilterValues.ofEmptyIsEverything( + "routes", + List.of(new FeedScopedId("F", "RUT:route:1"), new FeedScopedId("F", "RUT:route:2")) + ) + ) .withServiceJourneys( - List.of(new FeedScopedId("RUT:route:trip", "1"), new FeedScopedId("RUT:route:trip2", "1")) + FilterValues.ofEmptyIsEverything( + "serviceJourneys", + List.of( + new FeedScopedId("F", "RUT:route:trip:1"), + new FeedScopedId("F", "RUT:route:trip:2") + ) + ) ) .build(); diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index 6aef8d7f7e1..2cd4ed6d0cf 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -77,3 +77,14 @@ trip = Trip.of(id).withName("The Express").build(); // Modify and existing stop stop = stop.copyOf().withPrivateCode("TEX").build(); ``` + +## Referencing Established OTP Terminology in Documentation + +Use emphasis ("_dated service journey_") in markdown documentation, in API, and configuration +documentation. In this kind of documentation we usually talk about the concept, not the implementing +class. Use CamleCase (eg. TripOnServiceDate) if you need to reference the class. + +Use hyphen ("dated-service-journey") in plain text and JavaDoc. In JavaDoc we also use +{@link TripOnServiceDate} the first time we mention a class. Note that sometimes we want to talk +about the concept (dated-service-journey) and sometimes we reference a class +({@link DatedServiceJourney}). \ No newline at end of file From 404279041c62aa7af0c85cbeba4b212798be120c Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Nov 2024 17:20:32 +0100 Subject: [PATCH 45/55] Also delay jackson datatypes [ci skip] --- renovate.json5 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index d34b8573649..a5838fb3ff0 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -146,7 +146,8 @@ "description": "give some projects time to publish a changelog before opening the PR", "matchPackageNames": [ "com.google.dagger:{/,}**", - "com.fasterxml.jackson:{/,}**" + "com.fasterxml.jackson:{/,}**", + "com.fasterxml.jackson.datatype::{/,}**" ], "minimumReleaseAge": "1 week" }, From e919778fd2014be25befa3e60fd7887556c1d59a Mon Sep 17 00:00:00 2001 From: OTP Serialization Version Bot Date: Mon, 2 Dec 2024 07:29:00 +0000 Subject: [PATCH 46/55] Bump serialization version id for #6277 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 770525790f7..54d7e21cc78 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 173 + 174 32.1 2.52 From ff8c23155d7adde12585837f6026054e5fbe2a04 Mon Sep 17 00:00:00 2001 From: Zsombor Welker Date: Tue, 3 Dec 2024 06:40:31 +0100 Subject: [PATCH 47/55] Remove CAR_PICKUP snapshot transfer test --- .../mapping/CarPickupSnapshotTest.java | 71 - .../__snapshots__/CarPickupSnapshotTest.snap | 3438 ----------------- 2 files changed, 3509 deletions(-) delete mode 100644 application/src/test/java/org/opentripplanner/routing/algorithm/mapping/CarPickupSnapshotTest.java delete mode 100644 application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/CarPickupSnapshotTest.snap diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/CarPickupSnapshotTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/CarPickupSnapshotTest.java deleted file mode 100644 index c233d0c6bbc..00000000000 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/CarPickupSnapshotTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.opentripplanner.routing.algorithm.mapping; - -import au.com.origin.snapshots.junit5.SnapshotExtension; -import java.util.List; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.opentripplanner.model.GenericLocation; -import org.opentripplanner.model.modes.ExcludeAllTransitFilter; -import org.opentripplanner.routing.api.request.RouteRequest; -import org.opentripplanner.routing.api.request.StreetMode; -import org.opentripplanner.routing.api.request.request.filter.AllowAllTransitFilter; - -@ExtendWith(SnapshotExtension.class) -public class CarPickupSnapshotTest extends SnapshotTestBase { - - static GenericLocation p0 = new GenericLocation( - "SE Stark St. & SE 17th Ave. (P0)", - null, - 45.519320, - -122.648567 - ); - - static GenericLocation p1 = new GenericLocation( - "SE Morrison St. & SE 17th Ave. (P1)", - null, - 45.51726, - -122.64847 - ); - - static GenericLocation p2 = new GenericLocation( - "NW Northrup St. & NW 22nd Ave. (P2)", - null, - 45.53122, - -122.69659 - ); - - @BeforeAll - public static void beforeClass() { - loadGraphBeforeClass(false); - } - - @Test - public void test_trip_planning_with_car_pickup_only() { - RouteRequest request = createTestRequest(2009, 11, 17, 10, 0, 0); - - request.journey().direct().setMode(StreetMode.CAR_PICKUP); - request.journey().transit().setFilters(List.of(ExcludeAllTransitFilter.of())); - - request.setFrom(p0); - request.setTo(p2); - - expectRequestResponseToMatchSnapshot(request); - } - - @Test - public void test_trip_planning_with_car_pickup_transfer() { - RouteRequest request = createTestRequest(2009, 11, 17, 10, 0, 0); - - request.journey().access().setMode(StreetMode.WALK); - request.journey().egress().setMode(StreetMode.WALK); - request.journey().direct().setMode(StreetMode.WALK); - request.journey().transfer().setMode(StreetMode.CAR_PICKUP); - request.journey().transit().setFilters(List.of(AllowAllTransitFilter.of())); - - request.setFrom(p0); - request.setTo(p2); - - expectRequestResponseToMatchSnapshot(request); - } -} diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/CarPickupSnapshotTest.snap b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/CarPickupSnapshotTest.snap deleted file mode 100644 index a3a515f82b4..00000000000 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/CarPickupSnapshotTest.snap +++ /dev/null @@ -1,3438 +0,0 @@ -org.opentripplanner.routing.algorithm.mapping.CarPickupSnapshotTest.test_trip_planning_with_car_pickup_only=[ - [ - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 634, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:10:34.000+00:00", - "fare" : { - "details" : { }, - "fare" : { } - }, - "generalizedCost" : 1005, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 5050.5, - "endTime" : "2009-11-17T18:10:34.000+00:00", - "from" : { - "departure" : "2009-11-17T18:00:00.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 1005, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 200, - "points" : "unytGpxqkVA??dACpB@P?f@?p@?j@?dAAhE?jE?vD?PK?aC?{BAS?mC??hE?nEAfE?hE?hEAnC?^?Z?pB?J?~@?J}B?O?OAo@?A?w@?U?S?iB?O??Z?xC?XAJ?P?R@H@FBFBFBDDDBBDBF@F?d@@H@D@FBFD@BBDBF@H@L?L?b@@RBTGpJCjEA|CArAAxAAxAAdBEzHClF?@Ax@GTAjBAZQ?qBBuA@Y@[@aCDM@K?aCBCV@pCDZ@|D@N@vD?L?F?JBbD?D?N?BK?uBBM?K?uBBI@K?aBBSAM@M@K?GBEDEHIJUX_@f@KNQRSVGFCBQPIHGDGBIBK@W@a@?mA@E?C@C@A?CBQTKJEHIJeC~CYZo@v@g@d@IJAFAD?L@vC@hB@p@?X?T@P?N@P@nA?j@AX?L@`B@dA?R?RBbD?T?NBbD?R?P@|D@jB?x@@J?N?B?P?LBjD@N@fD?T?LBdD?R?PF`K?RDlJ?R?PFlJ?J" - }, - "mode" : "CAR", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:00:00.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 395.42, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 238.05, - "elevation" : "", - "lat" : 45.5193421, - "lon" : -122.6536397, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast 12th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 553.35, - "elevation" : "", - "lat" : 45.5214829, - "lon" : -122.6536226, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Ash Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 158.48, - "elevation" : "", - "lat" : 45.5215062, - "lon" : -122.6607251, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast Grand Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 78.88, - "elevation" : "", - "lat" : 45.5229315, - "lon" : -122.6607174, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northeast Grand Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 168.84, - "elevation" : "", - "lat" : 45.5236409, - "lon" : -122.6607123, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northeast Couch Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "SOUTHWEST", - "area" : false, - "bogusName" : false, - "distance" : 64.13, - "elevation" : "", - "lat" : 45.5231423, - "lon" : -122.6623136, - "relativeDirection" : "SLIGHTLY_RIGHT", - "stayOn" : true, - "streetName" : "Northeast Couch Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 144.26, - "elevation" : "", - "lat" : 45.522964, - "lon" : -122.6630306, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "East Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 407.38, - "elevation" : "", - "lat" : 45.523001, - "lon" : -122.6648816, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Burnside Bridge", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 178.19, - "elevation" : "", - "lat" : 45.5231054, - "lon" : -122.6701087, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "West Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 310.7, - "elevation" : "", - "lat" : 45.5231958, - "lon" : -122.6723802, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 2nd Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 317.18, - "elevation" : "", - "lat" : 45.5259887, - "lon" : -122.6724927, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Flanders Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 238.16, - "elevation" : "", - "lat" : 45.5259105, - "lon" : -122.6765581, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 6th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 465.44, - "elevation" : "", - "lat" : 45.5280515, - "lon" : -122.6766232, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northwest Station Way", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 1331.38, - "elevation" : "", - "lat" : 45.5315452, - "lon" : -122.679511, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:10:34.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:00:00.000+00:00", - "tooSloped" : false, - "transfers" : 0, - "transitTime" : 0, - "waitingTime" : 0, - "walkDistance" : 5050.5, - "walkLimitExceeded" : false, - "walkTime" : 634 - } - ] -] - - -org.opentripplanner.routing.algorithm.mapping.CarPickupSnapshotTest.test_trip_planning_with_car_pickup_transfer=[ - [ - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 3804, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T19:03:24.000+00:00", - "fare" : { - "details" : { }, - "fare" : { } - }, - "generalizedCost" : 7384, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 4875.79, - "endTime" : "2009-11-17T19:03:24.000+00:00", - "from" : { - "departure" : "2009-11-17T18:00:00.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 7384, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 252, - "points" : "unytGpxqkVA??dACpB@P?f@?p@?j@?dAAhE?jE?vD?P?RK?GFCDCFADABADADAF?D?FADCF?B?B?@?D@DADABCBC?A?C?AA??GICAAAA?A?A?AACAC?A@ABABC@CDCBCBC@CBABABCJ?J?@?@MR?hE?fEAdB?dB?lE?`A?T?pBA|D?J?x@?r@y@??bBuA?y@AU?{@?O?}@?E?y@?_@Aa@?u@?W??J@N?hA@x@Ap@ATETGpJCjEA|CArAAxAAxAAdBEzHClF?@Ax@GTAjBAZ?R@hC@h@Q@cBBM?M?_CDsA@Y?Q@O?K?Q?mBB[?C?W@[?]@E?IDI@]DO@SBM?S@G@A?GDEJQ|@AL?L@nA?j@@L?V?d@@~@@NI?E?W@Q?Q?m@@Q@AF?DAJBzB?V?NANM@K?GBEDEHIJUX_@f@KNQRSVGFCBQPIHGDGBIBK@W@a@?mA@E?C@C@A?CBQTKJEHIJeC~CYZo@v@g@d@IJAFAD?L@vC@hB@p@?X?T@P?N@P@nA?j@AX?L@`B@dA?R?RBbD?T?NBbD?R?P@|D@jB?x@@J?N?B?P?LBjD@N@fD?T?LBdD?R?PF`K?RDlJ?R?PFlJ?J" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:00:00.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 402.49, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : true, - "distance" : 131.76, - "elevation" : "", - "lat" : 45.5193421, - "lon" : -122.6537305, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "path", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 516.5, - "elevation" : "", - "lat" : 45.5200623, - "lon" : -122.6546522, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Oak Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : true, - "distance" : 70.84, - "elevation" : "", - "lat" : 45.5200842, - "lon" : -122.6612814, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "parking aisle", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 284.75, - "elevation" : "", - "lat" : 45.5203736, - "lon" : -122.661783, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast Martin Luther King, Junior Boulevard", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 243.45, - "elevation" : "", - "lat" : 45.5229343, - "lon" : -122.6617665, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "East Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 407.38, - "elevation" : "", - "lat" : 45.523001, - "lon" : -122.6648816, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Burnside Bridge", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 256.85, - "elevation" : "", - "lat" : 45.5231054, - "lon" : -122.6701087, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "West Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 460.65, - "elevation" : "", - "lat" : 45.5231776, - "lon" : -122.6733895, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 3rd Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 145.82, - "elevation" : "", - "lat" : 45.5272866, - "lon" : -122.6737165, - "relativeDirection" : "SLIGHTLY_LEFT", - "stayOn" : false, - "streetName" : "Northwest Hoyt Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 77.35, - "elevation" : "", - "lat" : 45.5273496, - "lon" : -122.6755629, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 5th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 80.53, - "elevation" : "", - "lat" : 45.5280449, - "lon" : -122.6755935, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Irving Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 465.44, - "elevation" : "", - "lat" : 45.5280515, - "lon" : -122.6766232, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest Station Way", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 1331.38, - "elevation" : "", - "lat" : 45.5315452, - "lon" : -122.679511, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T19:03:24.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:00:00.000+00:00", - "tooSloped" : false, - "transfers" : 0, - "transitTime" : 0, - "waitingTime" : 0, - "walkDistance" : 4875.79, - "walkLimitExceeded" : false, - "walkTime" : 3804 - }, - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 1815, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:34:19.000+00:00", - "fare" : { - "details" : { }, - "fare" : { }, - "legProducts" : [ - { - "legIndices" : [ - 1 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - }, - { - "legIndices" : [ - 5 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - } - ] - }, - "generalizedCost" : 3832, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 673.56, - "endTime" : "2009-11-17T18:12:58.000+00:00", - "from" : { - "departure" : "2009-11-17T18:04:04.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 1031, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 42, - "points" : "unytGpxqkVA??dACpB@PoC?_CAM?aC??A?A?A?A??AA?AAA??AAA???A?A?A???A@A??@A@?@??A@?@?BcC?mCAmCAmC?QBIYIWOH" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:04:04.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 79.12, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 402.13, - "elevation" : "", - "lat" : 45.5193388, - "lon" : -122.6495798, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 168.89, - "elevation" : "", - "lat" : 45.5228912, - "lon" : -122.6495528, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTHEAST", - "area" : false, - "bogusName" : false, - "distance" : 22.74, - "elevation" : "", - "lat" : 45.524409, - "lon" : -122.6495675, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northeast Sandy Boulevard", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:12:58.000+00:00", - "departure" : "2009-11-17T18:12:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 2119.06, - "endTime" : "2009-11-17T18:19:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:12:58.000+00:00", - "departure" : "2009-11-17T18:12:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "stopIndex" : 92, - "stopSequence" : 93, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 962, - "headsign" : "Beaverton TC", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:13:32.000+00:00", - "departure" : "2009-11-17T18:13:32.000+00:00", - "lat" : 45.523767, - "lon" : -122.651428, - "name" : "NE Sandy & 14th", - "stopCode" : "5058", - "stopId" : "prt:5058", - "stopIndex" : 93, - "stopSequence" : 94, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:14:00.000+00:00", - "departure" : "2009-11-17T18:14:00.000+00:00", - "lat" : 45.523103, - "lon" : -122.653064, - "name" : "NE Sandy & 12th", - "stopCode" : "5055", - "stopId" : "prt:5055", - "stopIndex" : 94, - "stopSequence" : 95, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:14:47.000+00:00", - "departure" : "2009-11-17T18:14:47.000+00:00", - "lat" : 45.523024, - "lon" : -122.656526, - "name" : "E Burnside & NE 9th", - "stopCode" : "819", - "stopId" : "prt:819", - "stopIndex" : 95, - "stopSequence" : 96, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:15:24.000+00:00", - "departure" : "2009-11-17T18:15:24.000+00:00", - "lat" : 45.523012, - "lon" : -122.659365, - "name" : "E Burnside & NE 6th", - "stopCode" : "805", - "stopId" : "prt:805", - "stopIndex" : 96, - "stopSequence" : 97, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:15:52.000+00:00", - "departure" : "2009-11-17T18:15:52.000+00:00", - "lat" : 45.523015, - "lon" : -122.661534, - "name" : "E Burnside & NE M L King", - "stopCode" : "705", - "stopId" : "prt:705", - "stopIndex" : 97, - "stopSequence" : 98, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:18:00.000+00:00", - "departure" : "2009-11-17T18:18:00.000+00:00", - "lat" : 45.523249, - "lon" : -122.671269, - "name" : "W Burnside & Burnside Bridge", - "stopCode" : "689", - "stopId" : "prt:689", - "stopIndex" : 98, - "stopSequence" : 99, - "vertexType" : "TRANSIT", - "zoneId" : "0" - } - ], - "legGeometry" : { - "length" : 50, - "points" : "coztGd}qkVNl@r@`CZhA`A`D??Ph@l@tBb@rARh@Pd@???BPj@@jA?jEAhE?pD???VAjE?hE?dB?b@???`AAhE?dD???l@C`EAhEEhE?bAA|@?XAZ@\\AzACnGKbKAjC?bE???JEnE@fEDlE@hE@~A" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "Burnside/Stark", - "routeId" : "prt:20", - "routeLongName" : "Burnside/Stark", - "routeShortName" : "20", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:12:58.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:19:00.000+00:00", - "departure" : "2009-11-17T18:19:00.000+00:00", - "lat" : 45.523169, - "lon" : -122.675893, - "name" : "W Burnside & NW 5th", - "stopCode" : "782", - "stopId" : "prt:782", - "stopIndex" : 99, - "stopSequence" : 100, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "transitLeg" : true, - "tripBlockId" : "2002", - "tripId" : "prt:200W1200" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 0.0, - "endTime" : "2009-11-17T18:19:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:19:00.000+00:00", - "departure" : "2009-11-17T18:19:00.000+00:00", - "lat" : 45.523169, - "lon" : -122.675893, - "name" : "W Burnside & NW 5th", - "stopCode" : "782", - "stopId" : "prt:782", - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "generalizedCost" : 1, - "interlineWithPreviousLeg" : false, - "legElevation" : "", - "legGeometry" : { - "length" : 2, - "points" : "wfztGjcwkVD?" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:19:00.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:19:00.000+00:00", - "departure" : "2009-11-17T18:19:00.000+00:00", - "lat" : 45.5231324, - "lon" : -122.6758917, - "name" : "West Burnside Street", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 1767.93, - "endTime" : "2009-11-17T18:24:16.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:19:00.000+00:00", - "departure" : "2009-11-17T18:19:00.000+00:00", - "lat" : 45.5231324, - "lon" : -122.6758917, - "name" : "West Burnside Street", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 510, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 97, - "points" : "qfztGjcwkV@`B?H?BM?iBBI?K?wBBK?K?sBDM@M@sB@K?K?uBBM?K?uBBI@K?aBBSAM@M@K?GBEDEHIJUX_@f@KNQRSVGFCBQPIHGDGBIBK@W@a@?mA@E?C@C@A?CBQTKJEHIJeC~CYZo@v@g@d@IJAFAD?L@vC@hB@p@?X?T@P?N@P@nA?j@AX?L@`B@dA?R?RBbD?T?NBbD?R?P@|D@jB?x@@J?N?B?P?LBjD@N" - }, - "mode" : "CAR", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:19:00.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 44.21, - "elevation" : "", - "lat" : 45.5231324, - "lon" : -122.6758917, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "West Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 548.38, - "elevation" : "", - "lat" : 45.5231221, - "lon" : -122.676459, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 6th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 465.44, - "elevation" : "", - "lat" : 45.5280515, - "lon" : -122.6766232, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northwest Station Way", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 709.95, - "elevation" : "", - "lat" : 45.5315452, - "lon" : -122.679511, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:24:16.000+00:00", - "departure" : "2009-11-17T18:24:16.000+00:00", - "lat" : 45.5313992, - "lon" : -122.6886162, - "name" : "corner of Northwest Northrup Street and path", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 70.46, - "endTime" : "2009-11-17T18:26:18.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:24:16.000+00:00", - "departure" : "2009-11-17T18:24:16.000+00:00", - "lat" : 45.5313992, - "lon" : -122.6886162, - "name" : "corner of Northwest Northrup Street and path", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 233, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 7, - "points" : "ez{tGzrykVC?I?@nBBH?d@??" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:24:16.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : true, - "distance" : 7.61, - "elevation" : "", - "lat" : 45.5313992, - "lon" : -122.6886162, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "path", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 62.85, - "elevation" : "", - "lat" : 45.5314676, - "lon" : -122.6886182, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:26:18.000+00:00", - "departure" : "2009-11-17T18:31:26.000+00:00", - "lat" : 45.531434, - "lon" : -122.689417, - "name" : "NW Northrup & 18th", - "stopCode" : "10776", - "stopId" : "prt:10776", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 547.79, - "endTime" : "2009-11-17T18:33:55.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:26:18.000+00:00", - "departure" : "2009-11-17T18:31:26.000+00:00", - "lat" : 45.531434, - "lon" : -122.689417, - "name" : "NW Northrup & 18th", - "stopCode" : "10776", - "stopId" : "prt:10776", - "stopIndex" : 20, - "stopSequence" : 21, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 1057, - "headsign" : "NW 23rd Ave", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:33:13.000+00:00", - "departure" : "2009-11-17T18:33:13.000+00:00", - "lat" : 45.531346, - "lon" : -122.694455, - "name" : "NW Northrup & 21st", - "stopCode" : "10777", - "stopId" : "prt:10777", - "stopIndex" : 21, - "stopSequence" : 22, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 8, - "points" : "cz{tGzwykV?VBhEFtKDvJ??@\\DnJ" - }, - "mode" : "TRAM", - "pathway" : false, - "realTime" : false, - "route" : "Portland Streetcar", - "routeId" : "prt:193", - "routeLongName" : "Portland Streetcar", - "routeType" : 0, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:31:26.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:33:55.000+00:00", - "departure" : "2009-11-17T18:33:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "stopIndex" : 22, - "stopSequence" : 23, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "9384", - "tripId" : "prt:1930W1210" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 18.81, - "endTime" : "2009-11-17T18:34:19.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:33:55.000+00:00", - "departure" : "2009-11-17T18:33:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 37, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 7, - "points" : "sy{tGxc{kV???LABF?B??J" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:33:55.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 18.81, - "elevation" : "", - "lat" : 45.5313019, - "lon" : -122.6964448, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:34:19.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:04:04.000+00:00", - "tooSloped" : false, - "transfers" : 1, - "transitTime" : 511, - "waitingTime" : 308, - "walkDistance" : 2530.76, - "walkLimitExceeded" : false, - "walkTime" : 996 - }, - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 1598, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:35:19.000+00:00", - "fare" : { - "details" : { }, - "fare" : { }, - "legProducts" : [ - { - "legIndices" : [ - 1 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - }, - { - "legIndices" : [ - 5 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - } - ] - }, - "generalizedCost" : 3378, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 408.65, - "endTime" : "2009-11-17T18:14:00.000+00:00", - "from" : { - "departure" : "2009-11-17T18:08:41.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 623, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 16, - "points" : "unytGpxqkVA??dACpB@P?f@?p@?j@?dAAhE?jE?vD?PJ?J@?S" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:08:41.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 395.42, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "SOUTH", - "area" : false, - "bogusName" : false, - "distance" : 12.54, - "elevation" : "", - "lat" : 45.5193421, - "lon" : -122.6536397, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast 12th Avenue", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:14:00.000+00:00", - "departure" : "2009-11-17T18:14:00.000+00:00", - "lat" : 45.519229, - "lon" : -122.653546, - "name" : "SE 12th & Stark", - "stopCode" : "6594", - "stopId" : "prt:6594", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 439.45, - "endTime" : "2009-11-17T18:16:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:14:00.000+00:00", - "departure" : "2009-11-17T18:14:00.000+00:00", - "lat" : 45.519229, - "lon" : -122.653546, - "name" : "SE 12th & Stark", - "stopCode" : "6594", - "stopId" : "prt:6594", - "stopIndex" : 32, - "stopSequence" : 33, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 720, - "headsign" : "Rose Qtr TC", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:14:44.000+00:00", - "departure" : "2009-11-17T18:14:44.000+00:00", - "lat" : 45.520674, - "lon" : -122.653544, - "name" : "SE 12th & Pine", - "stopCode" : "6589", - "stopId" : "prt:6589", - "stopIndex" : 33, - "stopSequence" : 34, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 11, - "points" : "cnytGdxrkVW?mC?{BA??Q?oC?mC?kBAa@?w@?" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "12th Ave", - "routeId" : "prt:70", - "routeLongName" : "12th Ave", - "routeShortName" : "70", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:14:00.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:16:00.000+00:00", - "departure" : "2009-11-17T18:16:00.000+00:00", - "lat" : 45.52318, - "lon" : -122.653507, - "name" : "NE 12th & Sandy", - "stopCode" : "6592", - "stopId" : "prt:6592", - "stopIndex" : 34, - "stopSequence" : 35, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "7004", - "tripId" : "prt:700W1150" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 0.0, - "endTime" : "2009-11-17T18:16:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:16:00.000+00:00", - "departure" : "2009-11-17T18:16:00.000+00:00", - "lat" : 45.52318, - "lon" : -122.653507, - "name" : "NE 12th & Sandy", - "stopCode" : "6592", - "stopId" : "prt:6592", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 1, - "interlineWithPreviousLeg" : false, - "legElevation" : "", - "legGeometry" : { - "length" : 2, - "points" : "{fztGlwrkV?V" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:16:00.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:16:00.000+00:00", - "departure" : "2009-11-17T18:16:00.000+00:00", - "lat" : 45.5231819, - "lon" : -122.6536285, - "name" : "Northeast 12th Avenue", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 1607.0, - "endTime" : "2009-11-17T18:21:03.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:16:00.000+00:00", - "departure" : "2009-11-17T18:16:00.000+00:00", - "lat" : 45.5231819, - "lon" : -122.6536285, - "name" : "Northeast 12th Avenue", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 473, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 81, - "points" : "{fztGdxrkVc@?C?_@AM?O?oBAO??jE?hEAhE?jE?hEAjE?lD?R?FO?]?qA?O?UBmE?k@EU??X?tC?X?P?HAjG?j@ARANCRG\\KFM\\IXCPKXELCJAHMd@?HM\\O`@KPKNKHMLKFIFYJk@P]JIBM@M@O@O?W@O?O?O?q@?Q@K@IBKDIFGFEFGLSFGHEHKZELGP" - }, - "mode" : "CAR", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:16:00.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 128.28, - "elevation" : "", - "lat" : 45.5231819, - "lon" : -122.6536285, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Northeast 12th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 553.03, - "elevation" : "", - "lat" : 45.5243354, - "lon" : -122.6536083, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northeast Davis Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 243.39, - "elevation" : "", - "lat" : 45.5243542, - "lon" : -122.6607071, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northeast Grand Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 542.09, - "elevation" : "", - "lat" : 45.5265408, - "lon" : -122.6606919, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northeast Lloyd Boulevard", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 140.22, - "elevation" : "", - "lat" : 45.5286604, - "lon" : -122.6657552, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "North Interstate Avenue", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:21:03.000+00:00", - "departure" : "2009-11-17T18:21:03.000+00:00", - "lat" : 45.5297183, - "lon" : -122.6664542, - "name" : "corner of North Interstate Avenue and path", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 43.34, - "endTime" : "2009-11-17T18:22:49.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:21:03.000+00:00", - "departure" : "2009-11-17T18:21:03.000+00:00", - "lat" : 45.5297183, - "lon" : -122.6664542, - "name" : "corner of North Interstate Avenue and path", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 196, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 13, - "points" : "uo{tGjhukVKIC?CDABCDABEFCHGCEEGK@A" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:21:03.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTHEAST", - "area" : false, - "bogusName" : true, - "distance" : 28.77, - "elevation" : "", - "lat" : 45.5297183, - "lon" : -122.6664542, - "relativeDirection" : "SLIGHTLY_RIGHT", - "stayOn" : false, - "streetName" : "path", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTHEAST", - "area" : false, - "bogusName" : false, - "distance" : 14.56, - "elevation" : "", - "lat" : 45.5299086, - "lon" : -122.6665929, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Rose Quarter Transit Center", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:22:49.000+00:00", - "departure" : "2009-11-17T18:25:00.000+00:00", - "lat" : 45.530005, - "lon" : -122.666476, - "name" : "Rose Quarter Transit Center", - "stopCode" : "2592", - "stopId" : "prt:2592", - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 2905.12, - "endTime" : "2009-11-17T18:34:55.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:22:49.000+00:00", - "departure" : "2009-11-17T18:25:00.000+00:00", - "lat" : 45.530005, - "lon" : -122.666476, - "name" : "Rose Quarter Transit Center", - "stopCode" : "2592", - "stopId" : "prt:2592", - "stopIndex" : 84, - "stopSequence" : 85, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "generalizedCost" : 1326, - "headsign" : "Montgomery Park", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:28:20.000+00:00", - "departure" : "2009-11-17T18:28:20.000+00:00", - "lat" : 45.526655, - "lon" : -122.676462, - "name" : "NW Glisan & 6th", - "stopCode" : "10803", - "stopId" : "prt:10803", - "stopIndex" : 85, - "stopSequence" : 86, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:29:15.000+00:00", - "departure" : "2009-11-17T18:29:15.000+00:00", - "lat" : 45.528799, - "lon" : -122.677238, - "name" : "NW Station Way & Union Station", - "stopCode" : "12801", - "stopId" : "prt:12801", - "stopIndex" : 86, - "stopSequence" : 87, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:31:00.000+00:00", - "departure" : "2009-11-17T18:31:00.000+00:00", - "lat" : 45.531582, - "lon" : -122.681193, - "name" : "NW Northrup & 10th", - "stopCode" : "12802", - "stopId" : "prt:12802", - "stopIndex" : 87, - "stopSequence" : 88, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:31:33.000+00:00", - "departure" : "2009-11-17T18:31:33.000+00:00", - "lat" : 45.531534, - "lon" : -122.683319, - "name" : "NW 12th & Northrup", - "stopCode" : "12796", - "stopId" : "prt:12796", - "stopIndex" : 88, - "stopSequence" : 89, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:32:04.000+00:00", - "departure" : "2009-11-17T18:32:04.000+00:00", - "lat" : 45.531503, - "lon" : -122.685357, - "name" : "NW Northrup & 14th", - "stopCode" : "10775", - "stopId" : "prt:10775", - "stopIndex" : 89, - "stopSequence" : 90, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:33:07.000+00:00", - "departure" : "2009-11-17T18:33:07.000+00:00", - "lat" : 45.531434, - "lon" : -122.689417, - "name" : "NW Northrup & 18th", - "stopCode" : "10776", - "stopId" : "prt:10776", - "stopIndex" : 90, - "stopSequence" : 91, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:34:24.000+00:00", - "departure" : "2009-11-17T18:34:24.000+00:00", - "lat" : 45.531346, - "lon" : -122.694455, - "name" : "NW Northrup & 21st", - "stopCode" : "10777", - "stopId" : "prt:10777", - "stopIndex" : 91, - "stopSequence" : 92, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 76, - "points" : "eq{tG`hukVNXJPPVJFf@Vf@Pp@Nd@NRLB@RNXZR\\vAhC@BhAhD`AhClAbDBrDCnG@n@@^@d@HdAP`CBjEDvD???LqCFmCDYBGDEBGJkAzAQR??KNa@b@MJuBBY?OHW@u@~@aD`EcBhBBrD@xC??@l@BlE@lD???XBjEBpD???VBlE?dA@t@?b@?h@BfEBrD???VBhEFtKDvJ??@\\DnJ" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "Broadway/Halsey", - "routeId" : "prt:77", - "routeLongName" : "Broadway/Halsey", - "routeShortName" : "77", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:25:00.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:34:55.000+00:00", - "departure" : "2009-11-17T18:34:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "stopIndex" : 92, - "stopSequence" : 93, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "7736", - "tripId" : "prt:771W1160" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 18.81, - "endTime" : "2009-11-17T18:35:19.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:34:55.000+00:00", - "departure" : "2009-11-17T18:34:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 37, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 7, - "points" : "sy{tGxc{kV???LABF?B??J" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:34:55.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 18.81, - "elevation" : "", - "lat" : 45.5313019, - "lon" : -122.6964448, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:35:19.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:08:41.000+00:00", - "tooSloped" : false, - "transfers" : 1, - "transitTime" : 715, - "waitingTime" : 131, - "walkDistance" : 2077.8, - "walkLimitExceeded" : false, - "walkTime" : 752 - }, - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 2077, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:38:41.000+00:00", - "fare" : { - "details" : { }, - "fare" : { }, - "legProducts" : [ - { - "legIndices" : [ - 1 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - } - ] - }, - "generalizedCost" : 3914, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 673.56, - "endTime" : "2009-11-17T18:12:58.000+00:00", - "from" : { - "departure" : "2009-11-17T18:04:04.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 1031, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 42, - "points" : "unytGpxqkVA??dACpB@PoC?_CAM?aC??A?A?A?A??AA?AAA??AAA???A?A?A???A@A??@A@?@??A@?@?BcC?mCAmCAmC?QBIYIWOH" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:04:04.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 79.12, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 402.13, - "elevation" : "", - "lat" : 45.5193388, - "lon" : -122.6495798, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 168.89, - "elevation" : "", - "lat" : 45.5228912, - "lon" : -122.6495528, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTHEAST", - "area" : false, - "bogusName" : false, - "distance" : 22.74, - "elevation" : "", - "lat" : 45.524409, - "lon" : -122.6495675, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northeast Sandy Boulevard", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:12:58.000+00:00", - "departure" : "2009-11-17T18:12:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 3602.73, - "endTime" : "2009-11-17T18:25:49.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:12:58.000+00:00", - "departure" : "2009-11-17T18:12:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "stopIndex" : 92, - "stopSequence" : 93, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 1371, - "headsign" : "Beaverton TC", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:13:32.000+00:00", - "departure" : "2009-11-17T18:13:32.000+00:00", - "lat" : 45.523767, - "lon" : -122.651428, - "name" : "NE Sandy & 14th", - "stopCode" : "5058", - "stopId" : "prt:5058", - "stopIndex" : 93, - "stopSequence" : 94, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:14:00.000+00:00", - "departure" : "2009-11-17T18:14:00.000+00:00", - "lat" : 45.523103, - "lon" : -122.653064, - "name" : "NE Sandy & 12th", - "stopCode" : "5055", - "stopId" : "prt:5055", - "stopIndex" : 94, - "stopSequence" : 95, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:14:47.000+00:00", - "departure" : "2009-11-17T18:14:47.000+00:00", - "lat" : 45.523024, - "lon" : -122.656526, - "name" : "E Burnside & NE 9th", - "stopCode" : "819", - "stopId" : "prt:819", - "stopIndex" : 95, - "stopSequence" : 96, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:15:24.000+00:00", - "departure" : "2009-11-17T18:15:24.000+00:00", - "lat" : 45.523012, - "lon" : -122.659365, - "name" : "E Burnside & NE 6th", - "stopCode" : "805", - "stopId" : "prt:805", - "stopIndex" : 96, - "stopSequence" : 97, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:15:52.000+00:00", - "departure" : "2009-11-17T18:15:52.000+00:00", - "lat" : 45.523015, - "lon" : -122.661534, - "name" : "E Burnside & NE M L King", - "stopCode" : "705", - "stopId" : "prt:705", - "stopIndex" : 97, - "stopSequence" : 98, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:18:00.000+00:00", - "departure" : "2009-11-17T18:18:00.000+00:00", - "lat" : 45.523249, - "lon" : -122.671269, - "name" : "W Burnside & Burnside Bridge", - "stopCode" : "689", - "stopId" : "prt:689", - "stopIndex" : 98, - "stopSequence" : 99, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:19:00.000+00:00", - "departure" : "2009-11-17T18:19:00.000+00:00", - "lat" : 45.523169, - "lon" : -122.675893, - "name" : "W Burnside & NW 5th", - "stopCode" : "782", - "stopId" : "prt:782", - "stopIndex" : 99, - "stopSequence" : 100, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:20:17.000+00:00", - "departure" : "2009-11-17T18:20:17.000+00:00", - "lat" : 45.523115, - "lon" : -122.678939, - "name" : "W Burnside & NW Park", - "stopCode" : "716", - "stopId" : "prt:716", - "stopIndex" : 100, - "stopSequence" : 101, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:21:25.000+00:00", - "departure" : "2009-11-17T18:21:25.000+00:00", - "lat" : 45.523048, - "lon" : -122.681606, - "name" : "W Burnside & NW 10th", - "stopCode" : "10791", - "stopId" : "prt:10791", - "stopIndex" : 101, - "stopSequence" : 102, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:22:14.000+00:00", - "departure" : "2009-11-17T18:22:14.000+00:00", - "lat" : 45.523, - "lon" : -122.683535, - "name" : "W Burnside & NW 12th", - "stopCode" : "11032", - "stopId" : "prt:11032", - "stopIndex" : 102, - "stopSequence" : 103, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:24:09.000+00:00", - "departure" : "2009-11-17T18:24:09.000+00:00", - "lat" : 45.522985, - "lon" : -122.688091, - "name" : "W Burnside & NW 17th", - "stopCode" : "10809", - "stopId" : "prt:10809", - "stopIndex" : 103, - "stopSequence" : 104, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:25:00.000+00:00", - "departure" : "2009-11-17T18:25:00.000+00:00", - "lat" : 45.523097, - "lon" : -122.690083, - "name" : "W Burnside & NW 19th", - "stopCode" : "735", - "stopId" : "prt:735", - "stopIndex" : 104, - "stopSequence" : 105, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:25:21.000+00:00", - "departure" : "2009-11-17T18:25:21.000+00:00", - "lat" : 45.523176, - "lon" : -122.692139, - "name" : "W Burnside & NW 20th", - "stopCode" : "741", - "stopId" : "prt:741", - "stopIndex" : 105, - "stopSequence" : 106, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:25:31.000+00:00", - "departure" : "2009-11-17T18:25:31.000+00:00", - "lat" : 45.52322, - "lon" : -122.69313, - "name" : "W Burnside & NW 20th Pl", - "stopCode" : "742", - "stopId" : "prt:742", - "stopIndex" : 106, - "stopSequence" : 107, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 94, - "points" : "coztGd}qkVNl@r@`CZhA`A`D??Ph@l@tBb@rARh@Pd@???BPj@@jA?jEAhE?pD???VAjE?hE?dB?b@???`AAhE?dD???l@C`EAhEEhE?bAA|@?XAZ@\\AzACnGKbKAjC?bE???JEnE@fEDlE@hE@~A??@rBBzDBpE@~A???Z@tD@RBnEB|A???@BdB?lEBjA??BnBApF@dB?X?^@r@?f@@bCAx@EtB???VChAE|BGnD??AXKnEGnD???XGjD??AZEfCC`AEzB" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "Burnside/Stark", - "routeId" : "prt:20", - "routeLongName" : "Burnside/Stark", - "routeShortName" : "20", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:12:58.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:25:49.000+00:00", - "departure" : "2009-11-17T18:25:49.000+00:00", - "lat" : 45.523312, - "lon" : -122.694901, - "name" : "W Burnside & NW King", - "stopCode" : "747", - "stopId" : "prt:747", - "stopIndex" : 107, - "stopSequence" : 108, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "2002", - "tripId" : "prt:200W1200" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 999.1, - "endTime" : "2009-11-17T18:38:41.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:25:49.000+00:00", - "departure" : "2009-11-17T18:25:49.000+00:00", - "lat" : 45.523312, - "lon" : -122.694901, - "name" : "W Burnside & NW King", - "stopCode" : "747", - "stopId" : "prt:747", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 1511, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 29, - "points" : "ugztGdzzkVL?ATClAI|DK?G?mCBkCDoCDmCBoCDkCBoCB[?sBD]?Y@eA@K?C?K?W@{A@M@C@I?_CB?G" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:25:49.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 113.27, - "elevation" : "", - "lat" : 45.5232491, - "lon" : -122.6949067, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "West Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 882.16, - "elevation" : "", - "lat" : 45.5233204, - "lon" : -122.696357, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 22nd Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "EAST", - "area" : false, - "bogusName" : false, - "distance" : 3.68, - "elevation" : "", - "lat" : 45.5312508, - "lon" : -122.6966386, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:38:41.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:04:04.000+00:00", - "tooSloped" : false, - "transfers" : 0, - "transitTime" : 771, - "waitingTime" : 0, - "walkDistance" : 1672.66, - "walkLimitExceeded" : false, - "walkTime" : 1306 - }, - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 1646, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:39:22.000+00:00", - "fare" : { - "details" : { }, - "fare" : { }, - "legProducts" : [ - { - "legIndices" : [ - 1 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - } - ] - }, - "generalizedCost" : 2662, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 290.72, - "endTime" : "2009-11-17T18:15:40.000+00:00", - "from" : { - "departure" : "2009-11-17T18:11:56.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 442, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 6, - "points" : "unytGpxqkVjC?lC@nC@?fCG?" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:11:56.000+00:00", - "steps" : [ - { - "absoluteDirection" : "SOUTH", - "area" : false, - "bogusName" : false, - "distance" : 237.26, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 53.47, - "elevation" : "", - "lat" : 45.5171863, - "lon" : -122.6485801, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast Morrison Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:15:40.000+00:00", - "departure" : "2009-11-17T18:15:40.000+00:00", - "lat" : 45.517226, - "lon" : -122.649266, - "name" : "SE Morrison & 16th", - "stopCode" : "4019", - "stopId" : "prt:4019", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 5218.86, - "endTime" : "2009-11-17T18:35:54.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:15:40.000+00:00", - "departure" : "2009-11-17T18:15:40.000+00:00", - "lat" : 45.517226, - "lon" : -122.649266, - "name" : "SE Morrison & 16th", - "stopCode" : "4019", - "stopId" : "prt:4019", - "stopIndex" : 50, - "stopSequence" : 51, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 1814, - "headsign" : "Montgomery Park", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:16:15.000+00:00", - "departure" : "2009-11-17T18:16:15.000+00:00", - "lat" : 45.517253, - "lon" : -122.651354, - "name" : "SE Morrison & 14th", - "stopCode" : "4016", - "stopId" : "prt:4016", - "stopIndex" : 51, - "stopSequence" : 52, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:17:00.000+00:00", - "departure" : "2009-11-17T18:17:00.000+00:00", - "lat" : 45.517299, - "lon" : -122.654067, - "name" : "SE Morrison & 12th", - "stopCode" : "4014", - "stopId" : "prt:4014", - "stopIndex" : 52, - "stopSequence" : 53, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:17:38.000+00:00", - "departure" : "2009-11-17T18:17:38.000+00:00", - "lat" : 45.517292, - "lon" : -122.656563, - "name" : "SE Morrison & 9th", - "stopCode" : "4026", - "stopId" : "prt:4026", - "stopIndex" : 53, - "stopSequence" : 54, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:18:08.000+00:00", - "departure" : "2009-11-17T18:18:08.000+00:00", - "lat" : 45.517322, - "lon" : -122.65847, - "name" : "SE Morrison & 7th", - "stopCode" : "4025", - "stopId" : "prt:4025", - "stopIndex" : 54, - "stopSequence" : 55, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:18:39.000+00:00", - "departure" : "2009-11-17T18:18:39.000+00:00", - "lat" : 45.517298, - "lon" : -122.660523, - "name" : "SE Morrison & Grand", - "stopCode" : "4013", - "stopId" : "prt:4013", - "stopIndex" : 55, - "stopSequence" : 56, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:20:03.000+00:00", - "departure" : "2009-11-17T18:20:03.000+00:00", - "lat" : 45.517351, - "lon" : -122.66601, - "name" : "Morrison Bridge", - "stopCode" : "4029", - "stopId" : "prt:4029", - "stopIndex" : 56, - "stopSequence" : 57, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:22:27.000+00:00", - "departure" : "2009-11-17T18:22:27.000+00:00", - "lat" : 45.51959, - "lon" : -122.674599, - "name" : "SW Washington & 3rd", - "stopCode" : "6158", - "stopId" : "prt:6158", - "stopIndex" : 57, - "stopSequence" : 58, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:23:00.000+00:00", - "departure" : "2009-11-17T18:23:00.000+00:00", - "lat" : 45.520129, - "lon" : -122.676635, - "name" : "SW Washington & 5th", - "stopCode" : "6160", - "stopId" : "prt:6160", - "stopIndex" : 58, - "stopSequence" : 59, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:23:52.000+00:00", - "departure" : "2009-11-17T18:23:52.000+00:00", - "lat" : 45.520695, - "lon" : -122.678657, - "name" : "SW Washington & Broadway", - "stopCode" : "6137", - "stopId" : "prt:6137", - "stopIndex" : 59, - "stopSequence" : 60, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:24:34.000+00:00", - "departure" : "2009-11-17T18:24:34.000+00:00", - "lat" : 45.521124, - "lon" : -122.6803, - "name" : "SW Washington & 9th", - "stopCode" : "6169", - "stopId" : "prt:6169", - "stopIndex" : 60, - "stopSequence" : 61, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:25:47.000+00:00", - "departure" : "2009-11-17T18:25:47.000+00:00", - "lat" : 45.521094, - "lon" : -122.682819, - "name" : "SW 11th & Alder", - "stopCode" : "9600", - "stopId" : "prt:9600", - "stopIndex" : 61, - "stopSequence" : 62, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:26:36.000+00:00", - "departure" : "2009-11-17T18:26:36.000+00:00", - "lat" : 45.52055, - "lon" : -122.683933, - "name" : "SW Morrison & 12th", - "stopCode" : "9598", - "stopId" : "prt:9598", - "stopIndex" : 62, - "stopSequence" : 63, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - { - "arrival" : "2009-11-17T18:27:25.000+00:00", - "departure" : "2009-11-17T18:27:25.000+00:00", - "lat" : 45.521063, - "lon" : -122.685848, - "name" : "SW Morrison & 14th", - "stopCode" : "9708", - "stopId" : "prt:9708", - "stopIndex" : 63, - "stopSequence" : 64, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:28:18.000+00:00", - "departure" : "2009-11-17T18:28:18.000+00:00", - "lat" : 45.521641, - "lon" : -122.687932, - "name" : "SW Morrison & 16th", - "stopCode" : "9613", - "stopId" : "prt:9613", - "stopIndex" : 64, - "stopSequence" : 65, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:29:00.000+00:00", - "departure" : "2009-11-17T18:29:00.000+00:00", - "lat" : 45.52206, - "lon" : -122.689577, - "name" : "SW Morrison & 17th", - "stopCode" : "9599", - "stopId" : "prt:9599", - "stopIndex" : 65, - "stopSequence" : 66, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:29:54.000+00:00", - "departure" : "2009-11-17T18:29:54.000+00:00", - "lat" : 45.523097, - "lon" : -122.690083, - "name" : "W Burnside & NW 19th", - "stopCode" : "735", - "stopId" : "prt:735", - "stopIndex" : 66, - "stopSequence" : 67, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:30:31.000+00:00", - "departure" : "2009-11-17T18:30:31.000+00:00", - "lat" : 45.523176, - "lon" : -122.692139, - "name" : "W Burnside & NW 20th", - "stopCode" : "741", - "stopId" : "prt:741", - "stopIndex" : 67, - "stopSequence" : 68, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:30:48.000+00:00", - "departure" : "2009-11-17T18:30:48.000+00:00", - "lat" : 45.52322, - "lon" : -122.69313, - "name" : "W Burnside & NW 20th Pl", - "stopCode" : "742", - "stopId" : "prt:742", - "stopIndex" : 68, - "stopSequence" : 69, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:31:20.000+00:00", - "departure" : "2009-11-17T18:31:20.000+00:00", - "lat" : 45.523312, - "lon" : -122.694901, - "name" : "W Burnside & NW King", - "stopCode" : "747", - "stopId" : "prt:747", - "stopIndex" : 69, - "stopSequence" : 70, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:32:18.000+00:00", - "departure" : "2009-11-17T18:32:18.000+00:00", - "lat" : 45.523512, - "lon" : -122.698081, - "name" : "W Burnside & NW 23rd", - "stopCode" : "755", - "stopId" : "prt:755", - "stopIndex" : 70, - "stopSequence" : 71, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:33:11.000+00:00", - "departure" : "2009-11-17T18:33:11.000+00:00", - "lat" : 45.525416, - "lon" : -122.698381, - "name" : "NW 23rd & Flanders", - "stopCode" : "7157", - "stopId" : "prt:7157", - "stopIndex" : 71, - "stopSequence" : 72, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:34:05.000+00:00", - "departure" : "2009-11-17T18:34:05.000+00:00", - "lat" : 45.527543, - "lon" : -122.698473, - "name" : "NW 23rd & Irving", - "stopCode" : "7161", - "stopId" : "prt:7161", - "stopIndex" : 72, - "stopSequence" : 73, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:35:00.000+00:00", - "departure" : "2009-11-17T18:35:00.000+00:00", - "lat" : 45.529681, - "lon" : -122.698529, - "name" : "NW 23rd & Lovejoy", - "stopCode" : "7163", - "stopId" : "prt:7163", - "stopIndex" : 73, - "stopSequence" : 74, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 135, - "points" : "kaytG||qkVA~@?jE?tC???r@AhE?jE?rA???tBAjE?nD???X?hE?xC??Ah@?pE?~C???J?`@?vAAvBEbE?jEAlE?`BAbB@d@??@tAAj@Cx@Cb@Cp@_@dEcAtFoA`IS~@i@`BmAzDi@zAc@pAi@~C??Id@u@jEm@bD??If@u@jEk@bD??If@u@|DW`B??CPs@|Du@lElBz@??VJbCfAk@dD??Id@w@rEWvAId@AF??Q~@s@`Ei@~C??Ib@u@dEWzA??]jB]MQSe@WOKOKIIQe@GWE]GnD??AXKnEGnD???XGjD??AZEfCC`AEzB??AXCfAGxDE|AEtBIlC??APkAh@o@?sCB{BD??S?mCDmCDyBB??U?mCDmCDyBB??S?oCDmCDmCBo@@" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "Belmont/NW 23rd", - "routeId" : "prt:15", - "routeLongName" : "Belmont/NW 23rd", - "routeShortName" : "15", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:15:40.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:35:54.000+00:00", - "departure" : "2009-11-17T18:35:54.000+00:00", - "lat" : 45.532159, - "lon" : -122.698634, - "name" : "NW 23rd & Overton", - "stopCode" : "8981", - "stopId" : "prt:8981", - "stopIndex" : 74, - "stopSequence" : 75, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "1549", - "tripId" : "prt:150W1400" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 266.21, - "endTime" : "2009-11-17T18:39:22.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:35:54.000+00:00", - "departure" : "2009-11-17T18:35:54.000+00:00", - "lat" : 45.532159, - "lon" : -122.698634, - "name" : "NW 23rd & Overton", - "stopCode" : "8981", - "stopId" : "prt:8981", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 405, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 13, - "points" : "}~{tGnq{kV?LVAF?J?L?rBCLA?Q?EAyAEcH?G" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:35:54.000+00:00", - "steps" : [ - { - "absoluteDirection" : "SOUTH", - "area" : false, - "bogusName" : false, - "distance" : 104.46, - "elevation" : "", - "lat" : 45.5321578, - "lon" : -122.6987026, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Northwest 23rd Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "EAST", - "area" : false, - "bogusName" : false, - "distance" : 161.77, - "elevation" : "", - "lat" : 45.5312188, - "lon" : -122.6986675, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:39:22.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:11:56.000+00:00", - "tooSloped" : false, - "transfers" : 0, - "transitTime" : 1214, - "waitingTime" : 0, - "walkDistance" : 556.93, - "walkLimitExceeded" : false, - "walkTime" : 432 - }, - { - "arrivedAtDestinationWithRentedBicycle" : false, - "duration" : 1635, - "elevationGained" : 0.0, - "elevationLost" : 0.0, - "endTime" : "2009-11-17T18:46:19.000+00:00", - "fare" : { - "details" : { }, - "fare" : { }, - "legProducts" : [ - { - "legIndices" : [ - 1 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - }, - { - "legIndices" : [ - 5 - ], - "products" : [ - { - "amount" : { - "cents" : 200, - "currency" : { - "currency" : "USD", - "currencyCode" : "USD", - "defaultFractionDigits" : 2, - "symbol" : "$" - } - }, - "id" : "prt:8", - "name" : "regular" - } - ] - } - ] - }, - "generalizedCost" : 3652, - "legs" : [ - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 673.56, - "endTime" : "2009-11-17T18:27:58.000+00:00", - "from" : { - "departure" : "2009-11-17T18:19:04.000+00:00", - "lat" : 45.51932, - "lon" : -122.648567, - "name" : "SE Stark St. & SE 17th Ave. (P0)", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 1031, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 42, - "points" : "unytGpxqkVA??dACpB@PoC?_CAM?aC??A?A?A?A??AA?AAA??AAA???A?A?A???A@A??@A@?@??A@?@?BcC?mCAmCAmC?QBIYIWOH" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:19:04.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 0.69, - "elevation" : "", - "lat" : 45.51932, - "lon" : -122.6485648, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Southeast 17th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 79.12, - "elevation" : "", - "lat" : 45.5193262, - "lon" : -122.6485648, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Southeast Stark Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 402.13, - "elevation" : "", - "lat" : 45.5193388, - "lon" : -122.6495798, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Southeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 168.89, - "elevation" : "", - "lat" : 45.5228912, - "lon" : -122.6495528, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northeast 16th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTHEAST", - "area" : false, - "bogusName" : false, - "distance" : 22.74, - "elevation" : "", - "lat" : 45.524409, - "lon" : -122.6495675, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northeast Sandy Boulevard", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:27:58.000+00:00", - "departure" : "2009-11-17T18:27:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 2119.06, - "endTime" : "2009-11-17T18:34:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:27:58.000+00:00", - "departure" : "2009-11-17T18:27:58.000+00:00", - "lat" : 45.524581, - "lon" : -122.649367, - "name" : "NE Sandy & 16th", - "stopCode" : "5060", - "stopId" : "prt:5060", - "stopIndex" : 92, - "stopSequence" : 93, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 962, - "headsign" : "23rd Ave to Tichner", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:28:32.000+00:00", - "departure" : "2009-11-17T18:28:32.000+00:00", - "lat" : 45.523767, - "lon" : -122.651428, - "name" : "NE Sandy & 14th", - "stopCode" : "5058", - "stopId" : "prt:5058", - "stopIndex" : 93, - "stopSequence" : 94, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:29:00.000+00:00", - "departure" : "2009-11-17T18:29:00.000+00:00", - "lat" : 45.523103, - "lon" : -122.653064, - "name" : "NE Sandy & 12th", - "stopCode" : "5055", - "stopId" : "prt:5055", - "stopIndex" : 94, - "stopSequence" : 95, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:29:47.000+00:00", - "departure" : "2009-11-17T18:29:47.000+00:00", - "lat" : 45.523024, - "lon" : -122.656526, - "name" : "E Burnside & NE 9th", - "stopCode" : "819", - "stopId" : "prt:819", - "stopIndex" : 95, - "stopSequence" : 96, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:30:24.000+00:00", - "departure" : "2009-11-17T18:30:24.000+00:00", - "lat" : 45.523012, - "lon" : -122.659365, - "name" : "E Burnside & NE 6th", - "stopCode" : "805", - "stopId" : "prt:805", - "stopIndex" : 96, - "stopSequence" : 97, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:30:52.000+00:00", - "departure" : "2009-11-17T18:30:52.000+00:00", - "lat" : 45.523015, - "lon" : -122.661534, - "name" : "E Burnside & NE M L King", - "stopCode" : "705", - "stopId" : "prt:705", - "stopIndex" : 97, - "stopSequence" : 98, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - { - "arrival" : "2009-11-17T18:33:00.000+00:00", - "departure" : "2009-11-17T18:33:00.000+00:00", - "lat" : 45.523249, - "lon" : -122.671269, - "name" : "W Burnside & Burnside Bridge", - "stopCode" : "689", - "stopId" : "prt:689", - "stopIndex" : 98, - "stopSequence" : 99, - "vertexType" : "TRANSIT", - "zoneId" : "0" - } - ], - "legGeometry" : { - "length" : 50, - "points" : "coztGd}qkVNl@r@`CZhA`A`D??Ph@l@tBb@rARh@Pd@???BPj@@jA?jEAhE?pD???VAjE?hE?dB?b@???`AAhE?dD???l@C`EAhEEhE?bAA|@?XAZ@\\AzACnGKbKAjC?bE???JEnE@fEDlE@hE@~A" - }, - "mode" : "BUS", - "pathway" : false, - "realTime" : false, - "route" : "Burnside/Stark", - "routeId" : "prt:20", - "routeLongName" : "Burnside/Stark", - "routeShortName" : "20", - "routeType" : 3, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:27:58.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:34:00.000+00:00", - "departure" : "2009-11-17T18:34:00.000+00:00", - "lat" : 45.523169, - "lon" : -122.675893, - "name" : "W Burnside & NW 5th", - "stopCode" : "782", - "stopId" : "prt:782", - "stopIndex" : 99, - "stopSequence" : 100, - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "transitLeg" : true, - "tripBlockId" : "2071", - "tripId" : "prt:200W1210" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 0.0, - "endTime" : "2009-11-17T18:34:00.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:34:00.000+00:00", - "departure" : "2009-11-17T18:34:00.000+00:00", - "lat" : 45.523169, - "lon" : -122.675893, - "name" : "W Burnside & NW 5th", - "stopCode" : "782", - "stopId" : "prt:782", - "vertexType" : "TRANSIT", - "zoneId" : "0" - }, - "generalizedCost" : 1, - "interlineWithPreviousLeg" : false, - "legElevation" : "", - "legGeometry" : { - "length" : 2, - "points" : "wfztGjcwkVD?" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:34:00.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:34:00.000+00:00", - "departure" : "2009-11-17T18:34:00.000+00:00", - "lat" : 45.5231324, - "lon" : -122.6758917, - "name" : "West Burnside Street", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 1767.93, - "endTime" : "2009-11-17T18:39:16.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:34:00.000+00:00", - "departure" : "2009-11-17T18:34:00.000+00:00", - "lat" : 45.5231324, - "lon" : -122.6758917, - "name" : "West Burnside Street", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 510, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 97, - "points" : "qfztGjcwkV@`B?H?BM?iBBI?K?wBBK?K?sBDM@M@sB@K?K?uBBM?K?uBBI@K?aBBSAM@M@K?GBEDEHIJUX_@f@KNQRSVGFCBQPIHGDGBIBK@W@a@?mA@E?C@C@A?CBQTKJEHIJeC~CYZo@v@g@d@IJAFAD?L@vC@hB@p@?X?T@P?N@P@nA?j@AX?L@`B@dA?R?RBbD?T?NBbD?R?P@|D@jB?x@@J?N?B?P?LBjD@N" - }, - "mode" : "CAR", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:34:00.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 44.21, - "elevation" : "", - "lat" : 45.5231324, - "lon" : -122.6758917, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "West Burnside Street", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 548.38, - "elevation" : "", - "lat" : 45.5231221, - "lon" : -122.676459, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "Northwest 6th Avenue", - "walkingBike" : false - }, - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : false, - "distance" : 465.44, - "elevation" : "", - "lat" : 45.5280515, - "lon" : -122.6766232, - "relativeDirection" : "CONTINUE", - "stayOn" : false, - "streetName" : "Northwest Station Way", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 709.95, - "elevation" : "", - "lat" : 45.5315452, - "lon" : -122.679511, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:39:16.000+00:00", - "departure" : "2009-11-17T18:39:16.000+00:00", - "lat" : 45.5313992, - "lon" : -122.6886162, - "name" : "corner of Northwest Northrup Street and path", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 70.46, - "endTime" : "2009-11-17T18:41:18.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:39:16.000+00:00", - "departure" : "2009-11-17T18:39:16.000+00:00", - "lat" : 45.5313992, - "lon" : -122.6886162, - "name" : "corner of Northwest Northrup Street and path", - "vertexType" : "NORMAL" - }, - "generalizedCost" : 233, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 7, - "points" : "ez{tGzrykVC?I?@nBBH?d@??" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:39:16.000+00:00", - "steps" : [ - { - "absoluteDirection" : "NORTH", - "area" : false, - "bogusName" : true, - "distance" : 7.61, - "elevation" : "", - "lat" : 45.5313992, - "lon" : -122.6886162, - "relativeDirection" : "RIGHT", - "stayOn" : false, - "streetName" : "path", - "walkingBike" : false - }, - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 62.85, - "elevation" : "", - "lat" : 45.5314676, - "lon" : -122.6886182, - "relativeDirection" : "LEFT", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:41:18.000+00:00", - "departure" : "2009-11-17T18:43:26.000+00:00", - "lat" : 45.531434, - "lon" : -122.689417, - "name" : "NW Northrup & 18th", - "stopCode" : "10776", - "stopId" : "prt:10776", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : false, - "walkingBike" : false - }, - { - "agencyId" : "prt:prt", - "agencyName" : "TriMet", - "agencyTimeZoneOffset" : -28800000, - "agencyUrl" : "http://trimet.org", - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 547.79, - "endTime" : "2009-11-17T18:45:55.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:41:18.000+00:00", - "departure" : "2009-11-17T18:43:26.000+00:00", - "lat" : 45.531434, - "lon" : -122.689417, - "name" : "NW Northrup & 18th", - "stopCode" : "10776", - "stopId" : "prt:10776", - "stopIndex" : 20, - "stopSequence" : 21, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 877, - "headsign" : "NW 23rd Ave", - "interlineWithPreviousLeg" : false, - "intermediateStops" : [ - { - "arrival" : "2009-11-17T18:45:13.000+00:00", - "departure" : "2009-11-17T18:45:13.000+00:00", - "lat" : 45.531346, - "lon" : -122.694455, - "name" : "NW Northrup & 21st", - "stopCode" : "10777", - "stopId" : "prt:10777", - "stopIndex" : 21, - "stopSequence" : 22, - "vertexType" : "TRANSIT", - "zoneId" : "1" - } - ], - "legGeometry" : { - "length" : 8, - "points" : "cz{tGzwykV?VBhEFtKDvJ??@\\DnJ" - }, - "mode" : "TRAM", - "pathway" : false, - "realTime" : false, - "route" : "Portland Streetcar", - "routeId" : "prt:193", - "routeLongName" : "Portland Streetcar", - "routeType" : 0, - "serviceDate" : "2009-11-17", - "startTime" : "2009-11-17T18:43:26.000+00:00", - "steps" : [ ], - "to" : { - "arrival" : "2009-11-17T18:45:55.000+00:00", - "departure" : "2009-11-17T18:45:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "stopIndex" : 22, - "stopSequence" : 23, - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "transitLeg" : true, - "tripBlockId" : "9385", - "tripId" : "prt:1930W1220" - }, - { - "agencyTimeZoneOffset" : -28800000, - "arrivalDelay" : 0, - "departureDelay" : 0, - "distance" : 18.81, - "endTime" : "2009-11-17T18:46:19.000+00:00", - "from" : { - "arrival" : "2009-11-17T18:45:55.000+00:00", - "departure" : "2009-11-17T18:45:55.000+00:00", - "lat" : 45.531308, - "lon" : -122.696445, - "name" : "NW Northrup & 22nd", - "stopCode" : "10778", - "stopId" : "prt:10778", - "vertexType" : "TRANSIT", - "zoneId" : "1" - }, - "generalizedCost" : 37, - "interlineWithPreviousLeg" : false, - "legGeometry" : { - "length" : 7, - "points" : "sy{tGxc{kV???LABF?B??J" - }, - "mode" : "WALK", - "pathway" : false, - "realTime" : false, - "rentedBike" : false, - "route" : "", - "startTime" : "2009-11-17T18:45:55.000+00:00", - "steps" : [ - { - "absoluteDirection" : "WEST", - "area" : false, - "bogusName" : false, - "distance" : 18.81, - "elevation" : "", - "lat" : 45.5313019, - "lon" : -122.6964448, - "relativeDirection" : "DEPART", - "stayOn" : false, - "streetName" : "Northwest Northrup Street", - "walkingBike" : false - } - ], - "to" : { - "arrival" : "2009-11-17T18:46:19.000+00:00", - "lat" : 45.53122, - "lon" : -122.69659, - "name" : "NW Northrup St. & NW 22nd Ave. (P2)", - "vertexType" : "NORMAL" - }, - "transitLeg" : false, - "walkingBike" : false - } - ], - "startTime" : "2009-11-17T18:19:04.000+00:00", - "tooSloped" : false, - "transfers" : 1, - "transitTime" : 511, - "waitingTime" : 128, - "walkDistance" : 2530.76, - "walkLimitExceeded" : false, - "walkTime" : 996 - } - ] -] \ No newline at end of file From 7aea107162e71b32c672bf1563a78bf378c51c2c Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 3 Dec 2024 08:21:07 +0100 Subject: [PATCH 48/55] Switch GTFS flex durations back to seconds --- .../java/org/opentripplanner/gtfs/mapping/TripMapper.java | 2 +- .../java/org/opentripplanner/gtfs/mapping/TripMapperTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java index daf20445767..7b1614aa4d5 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java @@ -84,7 +84,7 @@ private Optional mapSafeTimePenalty(org.onebusaway.gtfs.model.Trip } else { var offset = rhs.getSafeDurationOffset() == null ? Duration.ZERO - : Duration.ofMinutes(rhs.getSafeDurationOffset().longValue()); + : Duration.ofSeconds(rhs.getSafeDurationOffset().longValue()); var factor = rhs.getSafeDurationFactor() == null ? 1d : rhs.getSafeDurationFactor().doubleValue(); diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java index 4132b73826c..12df141eaf4 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java @@ -150,8 +150,8 @@ void testFlexFactorAndOffset( private static Stream provideOffsetAndFactor() { return Stream.of( - Arguments.of(1.5d, 60d, 1.5d, Duration.ofHours(1)), - Arguments.of(null, 120d, 1d, Duration.ofHours(2)), + Arguments.of(1.5d, 60d, 1.5d, Duration.ofMinutes(1)), + Arguments.of(null, 120d, 1d, Duration.ofMinutes(2)), Arguments.of(1.5d, null, 1.5d, Duration.ZERO) ); } From 2aefc16ccb38fc241965faa8fe70e8570c0b6d77 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 3 Dec 2024 14:46:02 +0100 Subject: [PATCH 49/55] Add English word as well --- .../java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java b/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java index 60cd8d0ac74..55bc87f5cad 100644 --- a/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java +++ b/application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java @@ -103,7 +103,8 @@ public void populateProperties(WayPropertySet props) { props.setProperties("highway=trunk", withModes(CAR).bicycleSafety(7.47)); props.setProperties("highway=motorway", withModes(CAR).bicycleSafety(8)); - // Do not walk on "moottoriliikennetie"/"Kraftfahrstrasse" + // Do not walk on "moottoriliikennetie"/"Kraftfahrstrasse"/"Limited access road" + // https://en.wikipedia.org/wiki/Limited-access_road props.setProperties(new ExactMatchSpecifier("motorroad=yes"), withModes(CAR)); /* cycleway=lane */ From 3c4f03a93e45320a712ad37f315d0323816eaf7a Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Tue, 3 Dec 2024 13:54:26 +0000 Subject: [PATCH 50/55] Add changelog entry for #6288 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 17a54ede4ae..c1fb8d42d13 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -54,6 +54,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Fix problem with relaxed-generalized-cost-at-destination [#6255](https://github.com/opentripplanner/OpenTripPlanner/pull/6255) - Reject SIRI-ET updates with empty StopPointRefs [#6266](https://github.com/opentripplanner/OpenTripPlanner/pull/6266) - Allow GTFS fuzzy trip matching even when trip descriptor has an id [#6250](https://github.com/opentripplanner/OpenTripPlanner/pull/6250) +- Make `motorroad=yes` car-only [#6288](https://github.com/opentripplanner/OpenTripPlanner/pull/6288) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 69e6f64f2566a58a81fa7d67c128bfd66041fdb7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:42:32 +0000 Subject: [PATCH 51/55] chore(deps): update debug ui dependencies (non-major) --- client/package-lock.json | 263 ++++++++++++++++++++++----------------- client/package.json | 16 +-- 2 files changed, 159 insertions(+), 120 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 36c05bdf4f1..bbed0b8e4fa 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -15,13 +15,13 @@ "graphql-request": "7.1.2", "maplibre-gl": "4.7.1", "react": "18.3.1", - "react-bootstrap": "2.10.5", + "react-bootstrap": "2.10.6", "react-dom": "18.3.1", "react-map-gl": "7.1.7" }, "devDependencies": { "@graphql-codegen/cli": "5.0.3", - "@graphql-codegen/client-preset": "4.5.0", + "@graphql-codegen/client-preset": "4.5.1", "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.5.0", "@testing-library/react": "16.0.1", @@ -30,19 +30,19 @@ "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", "@vitejs/plugin-react": "4.3.4", - "@vitest/coverage-v8": "2.1.5", + "@vitest/coverage-v8": "2.1.8", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", - "eslint-plugin-react-refresh": "0.4.14", + "eslint-plugin-react-refresh": "0.4.16", "jsdom": "25.0.1", - "prettier": "3.3.3", - "typescript": "5.6.3", - "vite": "6.0.1", - "vitest": "2.1.5" + "prettier": "3.4.1", + "typescript": "5.7.2", + "vite": "6.0.2", + "vitest": "2.1.8" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -989,9 +989,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1623,21 +1623,21 @@ } }, "node_modules/@graphql-codegen/client-preset": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.5.0.tgz", - "integrity": "sha512-0fFGSjpDhB7Jp6v+FQWDIeNJhL8VEiy3zeazyus3mGUELPaRQsoos2NczkDWnyMjSB1NHn4GrI53DB4TXkTAog==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.5.1.tgz", + "integrity": "sha512-UE2/Kz2eaxv35HIXFwlm2QwoUH77am6+qp54aeEWYq+T+WPwmIc6+YzqtGiT/VcaXgoOUSgidREGm9R6jKcf9g==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/template": "^7.20.7", "@graphql-codegen/add": "^5.0.3", - "@graphql-codegen/gql-tag-operations": "4.0.11", + "@graphql-codegen/gql-tag-operations": "4.0.12", "@graphql-codegen/plugin-helpers": "^5.1.0", - "@graphql-codegen/typed-document-node": "^5.0.11", - "@graphql-codegen/typescript": "^4.1.1", - "@graphql-codegen/typescript-operations": "^4.3.1", - "@graphql-codegen/visitor-plugin-common": "^5.5.0", + "@graphql-codegen/typed-document-node": "^5.0.12", + "@graphql-codegen/typescript": "^4.1.2", + "@graphql-codegen/typescript-operations": "^4.4.0", + "@graphql-codegen/visitor-plugin-common": "^5.6.0", "@graphql-tools/documents": "^1.0.0", "@graphql-tools/utils": "^10.0.0", "@graphql-typed-document-node/core": "3.2.0", @@ -1666,14 +1666,14 @@ } }, "node_modules/@graphql-codegen/gql-tag-operations": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.11.tgz", - "integrity": "sha512-EUQuBsYB5RtNlzBb/O0nJvbWC8HvPRWwVTHRf0ElOoQlJfRgfDom2GWmEM5hXa2afzMqB7AWxOH24ibOqiYnMQ==", + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.12.tgz", + "integrity": "sha512-v279i49FJ5dMmQXIGUgm6FtnnkxtJjVJWDNYh9JK4ppvOixdHp+PmEzW227DkLN6avhVxNnYdp/1gdRBwdWypw==", "dev": true, "license": "MIT", "dependencies": { "@graphql-codegen/plugin-helpers": "^5.1.0", - "@graphql-codegen/visitor-plugin-common": "5.5.0", + "@graphql-codegen/visitor-plugin-common": "5.6.0", "@graphql-tools/utils": "^10.0.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" @@ -1736,14 +1736,14 @@ } }, "node_modules/@graphql-codegen/typed-document-node": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.11.tgz", - "integrity": "sha512-btENKrSIUZ5UllS8sFhVZ+Y91VL0knK9gHxW/6/WzaCTxBQ+wOk07vQNeoWlvMrkl0QeUsGt6YvSo0SoPtsKdA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.12.tgz", + "integrity": "sha512-Wsbc1AqC+MFp3maWPzrmmyHLuWCPB63qBBFLTKtO6KSsnn0KnLocBp475wkfBZnFISFvzwpJ0e6LV71gKfTofQ==", "dev": true, "license": "MIT", "dependencies": { "@graphql-codegen/plugin-helpers": "^5.1.0", - "@graphql-codegen/visitor-plugin-common": "5.5.0", + "@graphql-codegen/visitor-plugin-common": "5.6.0", "auto-bind": "~4.0.0", "change-case-all": "1.0.15", "tslib": "~2.6.0" @@ -1756,15 +1756,15 @@ } }, "node_modules/@graphql-codegen/typescript": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.1.1.tgz", - "integrity": "sha512-+o5LOT71K9hdO4lDVnRGkkET5RdlKvxlQGug8dZgRGrhE2/xoPBsKfLhg9AoJGYMauNZxKj3blABQxHOKEku6Q==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.1.2.tgz", + "integrity": "sha512-GhPgfxgWEkBrvKR2y77OThus3K8B6U3ESo68l7+sHH1XiL2WapK5DdClViblJWKQerJRjfJu8tcaxQ8Wpk6Ogw==", "dev": true, "license": "MIT", "dependencies": { "@graphql-codegen/plugin-helpers": "^5.1.0", "@graphql-codegen/schema-ast": "^4.0.2", - "@graphql-codegen/visitor-plugin-common": "5.5.0", + "@graphql-codegen/visitor-plugin-common": "5.6.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -1776,15 +1776,15 @@ } }, "node_modules/@graphql-codegen/typescript-operations": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.3.1.tgz", - "integrity": "sha512-yW5Iia6IK1VKiPm3oeukYMQN5pEBLwRlG8ZzQA9beeLQ8PskKyz6mjar6U7dJ2hc8pv/qT4R8kcJOQ2RloniAQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.4.0.tgz", + "integrity": "sha512-oVlos2ySx8xIbbe8r5ZI6mOpI+OTeP14RmS2MchBJ6DL+S9G16O6+9V3Y8V22fTnmBTZkTfAAaBv4HYhhDGWVA==", "dev": true, "license": "MIT", "dependencies": { "@graphql-codegen/plugin-helpers": "^5.1.0", - "@graphql-codegen/typescript": "^4.1.1", - "@graphql-codegen/visitor-plugin-common": "5.5.0", + "@graphql-codegen/typescript": "^4.1.2", + "@graphql-codegen/visitor-plugin-common": "5.6.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -1796,9 +1796,9 @@ } }, "node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.5.0.tgz", - "integrity": "sha512-FSkxe/o4qKbpK+ipIT/jxZLYH0+3+XdIrJWsKlCW9wwJMF9mEJLJtzZNcxHSjz7+Eny6SUElAT2dqZ5XByxkog==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.6.0.tgz", + "integrity": "sha512-PowcVPJbUqMC9xTJ/ZRX1p/fsdMZREc+69CM1YY+AlFng2lL0zsdBskFJSRoviQk2Ch9IPhKGyHxlJCy9X22tg==", "dev": true, "license": "MIT", "dependencies": { @@ -3008,19 +3008,19 @@ } }, "node_modules/@restart/ui": { - "version": "1.6.9", - "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.9.tgz", - "integrity": "sha512-mUbygUsJcRurjZCt1f77gg4DpheD1D+Sc7J3JjAkysUj7t8m4EBJVOqWC9788Qtbc69cJ+HlJc6jBguKwS8Mcw==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.9.1.tgz", + "integrity": "sha512-qghR21ynHiUrpcIkKCoKYB+3rJtezY5Y7ikrwradCL+7hZHdQ2Ozc5ffxtpmpahoAGgc31gyXaSx2sXXaThmqA==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.21.0", - "@popperjs/core": "^2.11.6", + "@babel/runtime": "^7.26.0", + "@popperjs/core": "^2.11.8", "@react-aria/ssr": "^3.5.0", - "@restart/hooks": "^0.4.9", - "@types/warning": "^3.0.0", + "@restart/hooks": "^0.5.0", + "@types/warning": "^3.0.3", "dequal": "^2.0.3", "dom-helpers": "^5.2.0", - "uncontrollable": "^8.0.1", + "uncontrollable": "^8.0.4", "warning": "^4.0.3" }, "peerDependencies": { @@ -3028,6 +3028,18 @@ "react-dom": ">=16.14.0" } }, + "node_modules/@restart/ui/node_modules/@restart/hooks": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.5.0.tgz", + "integrity": "sha512-wS+h6IusJCPjTkmOOrRZxIPICD/mtFA3PRZviutoM23/b7akyDGfZF/WS+nIFk27u7JDhPE2+0GBdZxjSqHZkg==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/@restart/ui/node_modules/uncontrollable": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz", @@ -3742,9 +3754,9 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.5.tgz", - "integrity": "sha512-/RoopB7XGW7UEkUndRXF87A9CwkoZAJW01pj8/3pgmDVsjMH2IKy6H1A38po9tmUlwhSyYs0az82rbKd9Yaynw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.8.tgz", + "integrity": "sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==", "dev": true, "license": "MIT", "dependencies": { @@ -3765,8 +3777,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "2.1.5", - "vitest": "2.1.5" + "@vitest/browser": "2.1.8", + "vitest": "2.1.8" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -3775,14 +3787,14 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", - "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, @@ -3791,9 +3803,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", - "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3804,13 +3816,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", - "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.5", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -3818,13 +3830,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", - "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -3833,9 +3845,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", - "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "license": "MIT", "dependencies": { @@ -3846,13 +3858,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", - "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -5792,13 +5804,13 @@ } }, "node_modules/eslint-plugin-react-refresh": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.14.tgz", - "integrity": "sha512-aXvzCTK7ZBv1e7fahFuR3Z/fyQQSIQ711yPgYRj+Oj64tyTgO4iQIDmYXDBqvSWQ/FA4OSCsXOStlF+noU0/NA==", + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.16.tgz", + "integrity": "sha512-slterMlxAhov/DZO8NScf6mEeMBBXodFUolijDvrtTxyezyLoTQaa73FyYus/VbTdftd8wBgBxPMRk3poleXNQ==", "dev": true, "license": "MIT", "peerDependencies": { - "eslint": ">=7" + "eslint": ">=8.40" } }, "node_modules/eslint-plugin-react/node_modules/brace-expansion": { @@ -8896,9 +8908,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, "license": "MIT", "bin": { @@ -9022,14 +9034,14 @@ } }, "node_modules/react-bootstrap": { - "version": "2.10.5", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.5.tgz", - "integrity": "sha512-XueAOEn64RRkZ0s6yzUTdpFtdUXs5L5491QU//8ZcODKJNDLt/r01tNyriZccjgRImH1REynUc9pqjiRMpDLWQ==", + "version": "2.10.6", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.6.tgz", + "integrity": "sha512-fNvKytSp0nHts1WRnRBJeBEt+I9/ZdrnhIjWOucEduRNvFRU1IXjZueDdWnBiqsTSJ7MckQJi9i/hxGolaRq+g==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.24.7", "@restart/hooks": "^0.4.9", - "@restart/ui": "^1.6.9", + "@restart/ui": "^1.9.0", "@types/react-transition-group": "^4.4.6", "classnames": "^2.3.2", "dom-helpers": "^5.2.1", @@ -10374,9 +10386,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { @@ -10583,10 +10595,11 @@ } }, "node_modules/vite": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.1.tgz", - "integrity": "sha512-Ldn6gorLGr4mCdFnmeAOLweJxZ34HjKnDm4HGo6P66IEqTxQb36VEdFJQENKxWjupNfoIjvRUnswjn1hpYEpjQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.2.tgz", + "integrity": "sha512-XdQ+VsY2tJpBsKGs0wf3U/+azx8BBpYRHFAyKm5VeEZNOJZRB63q7Sc8Iup3k0TrN3KO6QgyzFf+opSbfY1y0g==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.24.0", "postcss": "^8.4.49", @@ -10654,9 +10667,9 @@ } }, "node_modules/vite-node": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", - "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "license": "MIT", "dependencies": { @@ -11142,19 +11155,19 @@ } }, "node_modules/vitest": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", - "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "2.1.5", - "@vitest/mocker": "2.1.5", - "@vitest/pretty-format": "^2.1.5", - "@vitest/runner": "2.1.5", - "@vitest/snapshot": "2.1.5", - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", @@ -11166,7 +11179,7 @@ "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.5", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { @@ -11181,8 +11194,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.5", - "@vitest/ui": "2.1.5", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -11215,6 +11228,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -11231,6 +11245,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -11247,6 +11262,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -11263,6 +11279,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -11279,6 +11296,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -11295,6 +11313,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -11311,6 +11330,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -11327,6 +11347,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -11343,6 +11364,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11359,6 +11381,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11375,6 +11398,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11391,6 +11415,7 @@ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11407,6 +11432,7 @@ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11423,6 +11449,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11439,6 +11466,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11455,6 +11483,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11471,6 +11500,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -11487,6 +11517,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -11503,6 +11534,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -11519,6 +11551,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -11535,6 +11568,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -11551,6 +11585,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -11567,6 +11602,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -11576,12 +11612,13 @@ } }, "node_modules/vitest/node_modules/@vitest/mocker": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", - "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.5", + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, @@ -11607,6 +11644,7 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -11644,6 +11682,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", diff --git a/client/package.json b/client/package.json index 57320f35540..f930bcd67d5 100644 --- a/client/package.json +++ b/client/package.json @@ -24,13 +24,13 @@ "graphql-request": "7.1.2", "maplibre-gl": "4.7.1", "react": "18.3.1", - "react-bootstrap": "2.10.5", + "react-bootstrap": "2.10.6", "react-dom": "18.3.1", "react-map-gl": "7.1.7" }, "devDependencies": { "@graphql-codegen/cli": "5.0.3", - "@graphql-codegen/client-preset": "4.5.0", + "@graphql-codegen/client-preset": "4.5.1", "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.5.0", "@testing-library/react": "16.0.1", @@ -39,18 +39,18 @@ "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", "@vitejs/plugin-react": "4.3.4", - "@vitest/coverage-v8": "2.1.5", + "@vitest/coverage-v8": "2.1.8", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", - "eslint-plugin-react-refresh": "0.4.14", + "eslint-plugin-react-refresh": "0.4.16", "jsdom": "25.0.1", - "prettier": "3.3.3", - "typescript": "5.6.3", - "vite": "6.0.1", - "vitest": "2.1.5" + "prettier": "3.4.1", + "typescript": "5.7.2", + "vite": "6.0.2", + "vitest": "2.1.8" } } From 4a61e111ed779810462623437c742228b7cb1288 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Wed, 4 Dec 2024 00:34:22 +0000 Subject: [PATCH 52/55] Add changelog entry for #6281 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index c1fb8d42d13..e216ef85fe0 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -55,6 +55,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Reject SIRI-ET updates with empty StopPointRefs [#6266](https://github.com/opentripplanner/OpenTripPlanner/pull/6266) - Allow GTFS fuzzy trip matching even when trip descriptor has an id [#6250](https://github.com/opentripplanner/OpenTripPlanner/pull/6250) - Make `motorroad=yes` car-only [#6288](https://github.com/opentripplanner/OpenTripPlanner/pull/6288) +- Add decision record for analysis and design documentation [#6281](https://github.com/opentripplanner/OpenTripPlanner/pull/6281) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 2de435c42ec9b82fd11b908f2c232d8e072dc9cb Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 4 Dec 2024 08:14:18 +0100 Subject: [PATCH 53/55] Apply new format --- .../src/components/ItineraryList/ItineraryLegDetails.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/ItineraryList/ItineraryLegDetails.tsx b/client/src/components/ItineraryList/ItineraryLegDetails.tsx index d23563331b5..65d790902a8 100644 --- a/client/src/components/ItineraryList/ItineraryLegDetails.tsx +++ b/client/src/components/ItineraryList/ItineraryLegDetails.tsx @@ -24,8 +24,11 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean {formatDistance(leg.distance)}, {formatDuration(leg.duration)} - -{' '} - + -

{leg.mode}{' '} {leg.line && ( From 27b18bd07ee13dc848eb84e3b3354c9f668b9682 Mon Sep 17 00:00:00 2001 From: OTP Bot Date: Wed, 4 Dec 2024 08:22:57 +0000 Subject: [PATCH 54/55] Upgrade debug client to version 2024/12/2024-12-04T08:22 --- application/src/client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/client/index.html b/application/src/client/index.html index 19ee598b816..391458fba41 100644 --- a/application/src/client/index.html +++ b/application/src/client/index.html @@ -5,8 +5,8 @@ OTP Debug Client - - + +
From 20502170aa7a195ce4f557c59c463414d05fd702 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Wed, 4 Dec 2024 13:42:31 +0000 Subject: [PATCH 55/55] Add changelog entry for #6298 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index e216ef85fe0..f6f9a55fb77 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -56,6 +56,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Allow GTFS fuzzy trip matching even when trip descriptor has an id [#6250](https://github.com/opentripplanner/OpenTripPlanner/pull/6250) - Make `motorroad=yes` car-only [#6288](https://github.com/opentripplanner/OpenTripPlanner/pull/6288) - Add decision record for analysis and design documentation [#6281](https://github.com/opentripplanner/OpenTripPlanner/pull/6281) +- Switch GTFS flex `safe_duration_offset` back to seconds [#6298](https://github.com/opentripplanner/OpenTripPlanner/pull/6298) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18)