The default maxTransfers should be the same in scripting and web interface, preferably a value of at least 4 (at least in my use case). Moreover, it would be useful to be able to configure it in scripts (see patch below).
I am running OTP in scripting mode (jython). When comparing its results to results from the web interface and to Google Maps, I noticed very long walking distances. The resulting total time is way over the actually needed time. After a lot of searching I found out that this is due to maxTransfers being set to 2 for scripts, whereas it is 4 for the web interface.
Affects OTP v1.2.0.
Patch to set maxTransfers and maxTransferWalkDistance in Scripts:
--- a/src/main/java/org/opentripplanner/scripting/api/OtpsRoutingRequest.java
+++ b/src/main/java/org/opentripplanner/scripting/api/OtpsRoutingRequest.java
@@ -91,6 +91,14 @@ public class OtpsRoutingRequest {
req.maxWalkDistance = maxWalkDistance;
}
+ public void setMaxTransferWalkDistance(double maxTransferWalkDistance) {
+ req.maxTransferWalkDistance = maxTransferWalkDistance;
+ }
+
+ public void setMaxTransfers(int maxTransfers) {
+ req.maxTransfers = maxTransfers;
+ }
+
public void setWheelchairAccessible(boolean wheelchairAccessible) {
req.wheelchairAccessible = wheelchairAccessible;
}
The default
maxTransfersshould be the same in scripting and web interface, preferably a value of at least 4 (at least in my use case). Moreover, it would be useful to be able to configure it in scripts (see patch below).I am running OTP in scripting mode (jython). When comparing its results to results from the web interface and to Google Maps, I noticed very long walking distances. The resulting total time is way over the actually needed time. After a lot of searching I found out that this is due to
maxTransfersbeing set to 2 for scripts, whereas it is 4 for the web interface.Affects OTP v1.2.0.
Patch to set
maxTransfersandmaxTransferWalkDistancein Scripts: