Repository navigation
Make graph time zone configurable - #4281
Conversation
OSMModule doesn't query the time zone so clearing cache is not necessary
Codecov Report
@@ Coverage Diff @@
## dev-2.x #4281 +/- ##
==========================================
Coverage 57.21% 57.22%
- Complexity 10767 10774 +7
==========================================
Files 1426 1427 +1
Lines 57938 57955 +17
Branches 6714 6715 +1
==========================================
+ Hits 33151 33162 +11
- Misses 22762 22766 +4
- Partials 2025 2027 +2
Continue to review full report at Codecov.
|
optionsome
left a comment
There was a problem hiding this comment.
Seems reasonable changes. However, I don't understand the wording in the GTFS specification "Timezone where the transit agency is located. If multiple agencies are specified in the dataset, each must have the same agency_timezone.". I have hard time interpreting that in any other way than that the time zone should be the same for each agency in one data set.
t2gran
left a comment
There was a problem hiding this comment.
This looks good, a few requested changes. The logic for setting and validating the timezone is probably not the transit models responsibility, but there is not a clear candidate for it, so this is fine for now.
…into otp2_configurable_time_zone
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com>
| public ZoneId asZoneId(String paramName, ZoneId defaultValue) { | ||
| return exist(paramName) ? ZoneId.of(param(paramName).asText()) : defaultValue; | ||
| } | ||
|
|
There was a problem hiding this comment.
This is missing a UnitTest, it also throws something else then a OTPApplication exception if the timezone is not found - that might be ok, but most other method do not. If the OTPApplication exception is thrown the application logs the error WITHOUT a stacktrace.
Currently this is not enforced, and there are no changes related to it. This is to support multiple bundles with different timezones |
I wonder what is the origin of that restriction in the specification. Seems like a really arbitrary limitation. |
… otp2_configurable_time_zone
https://groups.google.com/g/gtfs-changes/c/Sh0e4o9o2Gw/m/vd8t58WhW0oJ Here is some context for the decision |
Summary
Make it possible to configure the time zone when building the graph. Also throw an error, if multiple time zones are detected.
The scheduled times are adjusted to be in the configured time zone. No changes needed for real-time updaters are needed, as they operate on absolute times already.
Unit tests
New unit test for behaviour with multiple timezones is tested. TODO: Add tests for TimeZoneAdjusterModule
Documentation
Added configuration parameter