getSkipEdgeStrategy() {
var durationSkipEdgeStrategy = new DurationSkipEdgeStrategy(durationLimit);
if (maxStopCount > 0) {
- var strategy = new MaxCountSkipEdgeStrategy<>(maxStopCount, NearbyStopFinder::hasReachedStop);
+ var strategy = new MaxCountSkipEdgeStrategy<>(
+ maxStopCount,
+ StreetNearbyStopFinder::hasReachedStop
+ );
return new ComposingSkipEdgeStrategy<>(strategy, durationSkipEdgeStrategy);
}
return durationSkipEdgeStrategy;
@@ -328,10 +220,9 @@ private boolean canBoardFlex(State state, boolean reverse) {
* can dominate those that can thereby leading to zero found stops when this predicate is used with
* the {@link MaxCountSkipEdgeStrategy}.
*
- * An example of this would be an egress/reverse search with a very high walk reluctance where
- * the states that speculatively rent a vehicle move the walk states down the A* priority queue
- * until the required number of stops are reached to abort the search, leading to zero egress
- * results.
+ * An example of this would be an egress/reverse search with a very high walk reluctance where the
+ * states that speculatively rent a vehicle move the walk states down the A* priority queue until
+ * the required number of stops are reached to abort the search, leading to zero egress results.
*/
public static boolean hasReachedStop(State state) {
return state.getVertex() instanceof TransitStopVertex && state.isFinal();
diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java
index 6a1404c3039..06f4ff1cf45 100644
--- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java
+++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java
@@ -247,7 +247,6 @@ private Collection extends RoutingAccessEgress> fetchAccessEgresses(AccessEgre
var nearbyStops = AccessEgressRouter.streetSearch(
accessRequest,
temporaryVerticesContainer,
- serverContext.transitService(),
streetRequest,
serverContext.dataOverlayContext(accessRequest),
type.isEgress(),
diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java
index d8b4132ba66..f6a0526fa66 100644
--- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java
+++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java
@@ -2,10 +2,9 @@
import java.time.Duration;
import java.util.Collection;
-import java.util.List;
import org.opentripplanner.ext.dataoverlay.routing.DataOverlayContext;
import org.opentripplanner.framework.application.OTPRequestTimeoutException;
-import org.opentripplanner.graph_builder.module.NearbyStopFinder;
+import org.opentripplanner.graph_builder.module.nearbystops.StreetNearbyStopFinder;
import org.opentripplanner.routing.api.request.RouteRequest;
import org.opentripplanner.routing.api.request.request.StreetRequest;
import org.opentripplanner.routing.graphfinder.NearbyStop;
@@ -31,7 +30,6 @@ private AccessEgressRouter() {}
public static Collection streetSearch(
RouteRequest request,
TemporaryVerticesContainer verticesContainer,
- TransitService transitService,
StreetRequest streetRequest,
DataOverlayContext dataOverlayContext,
boolean fromTarget,
@@ -39,14 +37,12 @@ public static Collection streetSearch(
int maxStopCount
) {
OTPRequestTimeoutException.checkForTimeout();
- NearbyStopFinder nearbyStopFinder = new NearbyStopFinder(
- transitService,
+ var nearbyStopFinder = new StreetNearbyStopFinder(
durationLimit,
maxStopCount,
- dataOverlayContext,
- true
+ dataOverlayContext
);
- List nearbyStopList = nearbyStopFinder.findNearbyStopsViaStreets(
+ Collection nearbyStopList = nearbyStopFinder.findNearbyStops(
fromTarget ? verticesContainer.getToVertices() : verticesContainer.getFromVertices(),
fromTarget,
request,
diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/DirectFlexRouter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/DirectFlexRouter.java
index ff60138d77d..8e4cf1b222f 100644
--- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/DirectFlexRouter.java
+++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/DirectFlexRouter.java
@@ -37,7 +37,6 @@ public static List route(
Collection accessStops = AccessEgressRouter.streetSearch(
request,
temporaryVertices,
- serverContext.transitService(),
request.journey().direct(),
serverContext.dataOverlayContext(request),
false,
@@ -47,7 +46,6 @@ public static List route(
Collection egressStops = AccessEgressRouter.streetSearch(
request,
temporaryVertices,
- serverContext.transitService(),
request.journey().direct(),
serverContext.dataOverlayContext(request),
true,
diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/FlexAccessEgressRouter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/FlexAccessEgressRouter.java
index 5023e595678..68dda38211a 100644
--- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/FlexAccessEgressRouter.java
+++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/FlexAccessEgressRouter.java
@@ -37,7 +37,6 @@ public static Collection routeAccessEgress(
? AccessEgressRouter.streetSearch(
request,
verticesContainer,
- transitService,
new StreetRequest(StreetMode.WALK),
dataOverlayContext,
false,
@@ -50,7 +49,6 @@ public static Collection routeAccessEgress(
? AccessEgressRouter.streetSearch(
request,
verticesContainer,
- transitService,
new StreetRequest(StreetMode.WALK),
dataOverlayContext,
true,
diff --git a/src/main/resources/Message.properties b/src/main/resources/Message.properties
index 5c6011e3d3d..eafca543bd4 100644
--- a/src/main/resources/Message.properties
+++ b/src/main/resources/Message.properties
@@ -8,7 +8,8 @@ SYSTEM_ERROR = We're sorry. The trip planner is temporarily unavailable. Please
GRAPH_UNAVAILABLE = We're sorry. The trip planner is temporarily unavailable. Please try again later.
OUTSIDE_BOUNDS = Trip is not possible. You might be trying to plan a trip outside the map data boundary.
-PROCESSING_TIMEOUT = The trip planner is taking too long to process your request.
+UNPROCESSABLE_REQUEST = The trip planner is taking too long time or consuming too many resources to process your request.
+
BOGUS_PARAMETER = The request has errors that the server is not willing or able to process.
LOCATION_NOT_ACCESSIBLE = The location was found, but no stops could be found within the search radius.
PATH_NOT_FOUND = No trip found. There may be no transit service within the maximum specified distance or at the specified time, or your start or end point might not be safely accessible.
diff --git a/src/main/resources/Message_de.properties b/src/main/resources/Message_de.properties
index 1b0d8a2322e..7bace521ee8 100644
--- a/src/main/resources/Message_de.properties
+++ b/src/main/resources/Message_de.properties
@@ -2,7 +2,8 @@ PLAN_OK = Success
SYSTEM_ERROR = Es tut uns leid, leider steht der Trip-Planer momentan nicht zur Verfügung. Bitte versuchen Sie es zu einem späteren Zeitpunkt nochmal.
OUTSIDE_BOUNDS = Planung nicht möglich. Vielleicht versuchen sie einen Plan außerhalb der Kartengrenzen zu planen.
-PROCESSING_TIMEOUT = Der Trip-Planner braucht zu lange um die Anfrage zu bearbeiten
+UNPROCESSABLE_REQUEST = Der Trip-Planner braucht zu lange oder verbraucht zu viele Ressourcen, um die Anfrage zu bearbeiten
+
BOGUS_PARAMETER = Die Anfrage ist fehlerhaft so dass sie der Server nicht bearbeiten möchte oder kann.
PATH_NOT_FOUND = Planung nicht möglich. Ihr Start- oder Endpunkt könnte nicht erreichbar sein. Bitte stellen sie sicher, dass ihre Anfrage innerhalb der Kartendaten ist.
NO_TRANSIT_TIMES = Keine Fahrzeiten verfügbar. Das Datum kann zu weit in der Vergangenheit oder zu weit in der Zukunft liegen oder es gibt keinen Verkehrsbetrieb zu dem von Ihnen gewählten Zeitpunkt.
diff --git a/src/main/resources/Message_es.properties b/src/main/resources/Message_es.properties
index 0c5fe7a9395..1cdf7980252 100644
--- a/src/main/resources/Message_es.properties
+++ b/src/main/resources/Message_es.properties
@@ -8,7 +8,8 @@ SYSTEM_ERROR = ES-We're sorry. The trip planner is temporarily unavailable. Plea
GRAPH_UNAVAILABLE = ES-We're sorry. The trip planner is temporarily unavailable. Please try again later.
OUTSIDE_BOUNDS = ES-los trip is not possible. You might be trying to plan a trip outside the map data boundary.
-PROCESSING_TIMEOUT = ES-los trip planner is taking too long to process your request.
+UNPROCESSABLE_REQUEST = ES-los trip planner is taking too long time or consuming many resources to process your request.
+
BOGUS_PARAMETER = ES-los request has errors that the server is not willing or able to process.
PATH_NOT_FOUND = ES-los trip is not possible. Please check that you plan is within the bound of the map.
NO_TRANSIT_TIMES = ES-Non transit times available. The date may be past or too far in the future or there may not be transit service for your trip at the time you chose.
diff --git a/src/main/resources/Message_fr.properties b/src/main/resources/Message_fr.properties
index 6f7b73c1997..66ff82bbc59 100644
--- a/src/main/resources/Message_fr.properties
+++ b/src/main/resources/Message_fr.properties
@@ -8,7 +8,7 @@ SYSTEM_ERROR = Désolé: le calculateur d'itinéraires est temporairement indisp
GRAPH_UNAVAILABLE = Désolé: le calculateur d'itinéraires est temporairement indisponible. Veuillez recommencer ultérieurement.
OUTSIDE_BOUNDS = Impossible de calculer un itinéraire. Vous essayez de planifier un itinéraire hors des limites de la zone couverte.
-PROCESSING_TIMEOUT = Le calculateur d'itinéraires prend trop de temps pour gérer votre demande.
+UNPROCESSABLE_REQUEST = Le calculateur d'itinéraires prend trop de temps ou de resources pour gérer votre demande.
BOGUS_PARAMETER = Le serveur ne peut pas prendre en compte la requête, elle contient des paramètres erronés.
PATH_NOT_FOUND = Impossible de calculer un itinéraire. Veuillez vérifier que le trajet demandé est inclus dans la zone couverte.
NO_TRANSIT_TIMES = Aucun voyage disponible. Soit la date est trop loin dans le futur, soit il n'y a pas de service ce jour.
diff --git a/src/main/resources/Message_hu.properties b/src/main/resources/Message_hu.properties
index eca5fad9b10..f72f2295581 100644
--- a/src/main/resources/Message_hu.properties
+++ b/src/main/resources/Message_hu.properties
@@ -8,7 +8,7 @@ SYSTEM_ERROR = Sajn\u00E1ljuk. Az \u00FAtvonaltervez\u0151 \u00E1tmenetileg
GRAPH_UNAVAILABLE = Sajn\u00E1ljuk. Az \u00FAtvonaltervez\u0151 \u00E1tmenetileg nem el\u00E9rhet\u0151. K\u00E9rj\u00FCk, pr\u00F3b\u00E1lja \u00FAjra k\u00E9s\u0151bb.
OUTSIDE_BOUNDS = Az utaz\u00E1s nem lehets\u00E9ges. Lehet, hogy a t\u00E9rk\u00E9padat-hat\u00E1ron k\u00EDv\u00FCli utat pr\u00F3b\u00E1l megtervezni.
-PROCESSING_TIMEOUT = Az utaz\u00E1stervez\u0151 t\u00FAl sok\u00E1ig tart a k\u00E9r\u00E9s feldolgoz\u00E1s\u00E1hoz.
+UNPROCESSABLE_REQUEST = Az utaz\u00E1stervez\u0151 t\u00FAl sok\u00E1ig tart a k\u00E9r\u00E9s feldolgoz\u00E1s\u00E1hoz.
BOGUS_PARAMETER = A k\u00E9r\u00E9s olyan hib\u00E1kat tartalmaz, amelyeket a szerver nem hajland\u00F3 vagy nem k\u00E9pes feldolgozni.
LOCATION_NOT_ACCESSIBLE = A helyek megtal\u00E1lhat\u00F3ak, de meg\u00E1ll\u00F3k nem tal\u00E1lhat\u00F3 a keres\u00E9si k\u00F6rzetben.
PATH_NOT_FOUND = Nem tal\u00E1lhat\u00F3 utaz\u00E1s. El\u0151fordulhat, hogy a megadott maxim\u00E1lis t\u00E1vols\u00E1gon bel\u00FCl vagy a megadott id\u0151pontban nincs t\u00F6megk\u00F6zleked\u00E9si szolg\u00E1ltat\u00E1s, vagy a kezd\u0151- vagy v\u00E9gpont nem \u00E9rhet\u0151 el biztons\u00E1gosan.
diff --git a/src/main/resources/Message_nl.properties b/src/main/resources/Message_nl.properties
index 1e18c998264..2a7a1b7700b 100644
--- a/src/main/resources/Message_nl.properties
+++ b/src/main/resources/Message_nl.properties
@@ -8,7 +8,7 @@ SYSTEM_ERROR = Onze excuses. De routeplanner is momenteel niet beschikbaar. Prob
GRAPH_UNAVAILABLE = Onze excuses. De routeplanner is momenteel niet beschikbaar. Probeer later opnieuw.
OUTSIDE_BOUNDS = Deze reis is niet mogelijk. Mogelijk probeert u een reis te plannen buiten het beschikbare gebied
-PROCESSING_TIMEOUT = De routeplanner is te lang bezig met uw verzoek.
+UNPROCESSABLE_REQUEST = De routeplanner is te lang bezig met uw verzoek.
BOGUS_PARAMETER = Uw verzoek bevat fouten die de server niet wil or kan verwerken.
PATH_NOT_FOUND = Reis is niet mogelijk. Misschien is het startpunt of de bestemming niet veilig toegankelijk. Bijvoorbeeld een straat alleen verbonden met een snelweg.
NO_TRANSIT_TIMES = Geen OV-informatie beschikbaar. De datum is mogelijk te ver in het verleden of te ver in de toekomst. Of er is geen dienst voor uw reis op het moment dat u wilt.
diff --git a/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java b/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java
index bce971e9f1e..b697adc9288 100644
--- a/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java
+++ b/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java
@@ -34,6 +34,21 @@ class ExecutionResultMapperTest {
"}"
);
+ public static final String TOO_LARGE_MESSAGE =
+ "The number of fields in the GraphQL result exceeds the maximum allowed: 100000";
+
+ private static final String TOO_LARGE_RESPONSE = quoteReplace(
+ "{'" +
+ "errors':[{" +
+ "'message':'" +
+ TOO_LARGE_MESSAGE +
+ "'," +
+ "'locations':[]," +
+ "'extensions':{'classification':'ResponseTooLarge'}" +
+ "}]" +
+ "}"
+ );
+
public static final String SYSTEM_ERROR_MESSAGE = "A system error!";
public static final String SYSTEM_ERROR_RESPONSE = quoteReplace(
@@ -62,6 +77,13 @@ void timeoutResponse() {
assertEquals(TIMEOUT_RESPONSE, response.getEntity().toString());
}
+ @Test
+ void tooLargeResponse() {
+ var response = ExecutionResultMapper.tooLargeResponse(TOO_LARGE_MESSAGE);
+ assertEquals(422, response.getStatus());
+ assertEquals(TOO_LARGE_RESPONSE, response.getEntity().toString());
+ }
+
@Test
void systemErrorResponse() {
var response = ExecutionResultMapper.systemErrorResponse(SYSTEM_ERROR_MESSAGE);
diff --git a/src/test/java/org/opentripplanner/astar/strategy/MaxCountSkipEdgeStrategyTest.java b/src/test/java/org/opentripplanner/astar/strategy/MaxCountSkipEdgeStrategyTest.java
index 17dc26a4c5e..88976591ea1 100644
--- a/src/test/java/org/opentripplanner/astar/strategy/MaxCountSkipEdgeStrategyTest.java
+++ b/src/test/java/org/opentripplanner/astar/strategy/MaxCountSkipEdgeStrategyTest.java
@@ -4,7 +4,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
-import org.opentripplanner.graph_builder.module.NearbyStopFinder;
+import org.opentripplanner.graph_builder.module.nearbystops.StreetNearbyStopFinder;
import org.opentripplanner.street.search.state.TestStateBuilder;
class MaxCountSkipEdgeStrategyTest {
@@ -12,7 +12,7 @@ class MaxCountSkipEdgeStrategyTest {
@Test
void countStops() {
var state = TestStateBuilder.ofWalking().stop().build();
- var strategy = new MaxCountSkipEdgeStrategy<>(1, NearbyStopFinder::hasReachedStop);
+ var strategy = new MaxCountSkipEdgeStrategy<>(1, StreetNearbyStopFinder::hasReachedStop);
assertFalse(strategy.shouldSkipEdge(state, null));
assertTrue(strategy.shouldSkipEdge(state, null));
}
@@ -20,7 +20,7 @@ void countStops() {
@Test
void doNotCountStop() {
var state = TestStateBuilder.ofWalking().build();
- var strategy = new MaxCountSkipEdgeStrategy<>(1, NearbyStopFinder::hasReachedStop);
+ var strategy = new MaxCountSkipEdgeStrategy<>(1, StreetNearbyStopFinder::hasReachedStop);
assertFalse(strategy.shouldSkipEdge(state, null));
assertFalse(strategy.shouldSkipEdge(state, null));
assertFalse(strategy.shouldSkipEdge(state, null));
@@ -30,7 +30,7 @@ void doNotCountStop() {
void nonFinalState() {
var state = TestStateBuilder.ofScooterRentalArriveBy().stop().build();
assertFalse(state.isFinal());
- var strategy = new MaxCountSkipEdgeStrategy<>(1, NearbyStopFinder::hasReachedStop);
+ var strategy = new MaxCountSkipEdgeStrategy<>(1, StreetNearbyStopFinder::hasReachedStop);
assertFalse(strategy.shouldSkipEdge(state, null));
}
}
diff --git a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json
index c0e31a26f5d..d0aed828f6f 100644
--- a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json
+++ b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json
@@ -29,7 +29,7 @@
"type" : "line",
"source" : "vectorSource",
"source-layer" : "edges",
- "minzoom" : 13,
+ "minzoom" : 6,
"maxzoom" : 23,
"paint" : {
"line-color" : "#f21d52",