-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include empty rail stops in transfers #6208
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6208 +/- ##
=============================================
- Coverage 69.75% 69.70% -0.05%
- Complexity 17652 17683 +31
=============================================
Files 2006 2008 +2
Lines 75525 75812 +287
Branches 7731 7761 +30
=============================================
+ Hits 52679 52847 +168
- Misses 20134 20251 +117
- Partials 2712 2714 +2 ☔ View full report in Codecov by Sentry. |
I don't think setting this is possible for GTFS feeds. Is it possible to make this work? My deployment returns |
@miklcct For the record, it is possible to set This PR is a temporary fix, and we are removing this feature when the underlying bug is fixed. |
I have set the |
application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/transit/model/site/RegularStop.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of typos but generally this looks good.
Look forward to the more general solution.
application/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java
Show resolved
Hide resolved
Co-authored-by: Leonard Ehrenfried <[email protected]>
application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java
Outdated
Show resolved
Hide resolved
@@ -140,7 +140,7 @@ List<RegularStop> findStopsInFlexArea( | |||
List<RegularStop> stops = stopsSpatialIndex | |||
.query(geometry.getEnvelopeInternal()) | |||
.stream() | |||
.filter(stop -> flexibleStopTransitMode == stop.getGtfsVehicleType()) | |||
.filter(stop -> flexibleStopTransitMode == stop.getVehicleType()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for? Vehicle type information is not required, I don't know how much we should rely on that information in general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this is in the netex mapping, perhaps it's required there and this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no clue, I just renamed the very confusing method name - as you noticed, it is used for both GTFS and NeTEx so having GTFS as part of the name is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used to show a stop's mode in the API. However, since it's not required we also deduce it from the patterns that visit the stop:
Lines 730 to 739 in 09e2de7
/** | |
* For each pattern visiting this {@link StopLocation} return its {@link TransitMode} | |
*/ | |
private Stream<TransitMode> getPatternModesOfStop(StopLocation stop) { | |
if (stop.getGtfsVehicleType() != null) { | |
return Stream.of(stop.getGtfsVehicleType()); | |
} else { | |
return getPatternsForStop(stop).stream().map(TripPattern::getMode); | |
} | |
} |
…ation/OTPFeature.java Co-authored-by: Joel Lappalainen <[email protected]>
af8c99b
to
d1f8e3c
Compare
Can you update the generated documentation? |
Summary
Include regular transfers with from/to "empty" rail stops (platforms) when using the
OTPFeature#ConsiderPatternsForDirectTransfers
. It is common for stops to be assign at realtime for rail, if so turningOTPFeature#IncludeEmptyRailStopsInTransfers
on will help to avoid dropping transfers witch is needed when the realtime is applied. We assume the set of truly unused rail stops is limited; Hence the performance overhead of adding them all should be limited.Note! This is only applied to stops witch has vehicleType Rail. If the input feeds does not have a mode set for the stop
this fix will not work! Consider turning off
ConsiderPatternsForDirectTransfers
instead or fix the feeds.Issue
This will help for issue #5461, but is not the ideal fix. The real fix is to generate transfers (both ways) for stops used in realtime - especially stops going from zero patterns to having at least one.
Unit tests
This is hard to test, no test exist for the
PatternConsideringNearbyStopFinder
as is. I have manually tested the case in issue #5461 - and this fix does work for it.Documentation
✅ The new feature flag is documented.
Changelog
✅ Minor feature
Bumping the serialization version id
Only a new feature flag is added to the model, so there is no need to bump the ser-ver-id.