Open scrudden opened 5 years ago
These are important questions and a great opportunity for making TheTransitClock more dynamic and valuable.
VehicleEvents
where eventtype = "No match" could be used as the initial trigger. Currently you have to differentiate these events between schedule adherence out of bounds (not a detour) and N bad spatial matches in a row (likely a detour).
Whatever underlying structures are developed to support detours / dynamic re-routing, they should definitely support translation into GTFS-realtime. For example, the current GTFS-realtime spec supports trips with status "Added" or "Canceled", and StopTimeUpdates with status "skipped". I would also recommend checking out the GTFS-ServiceChanges proposal and discussion, which would be a new extension covering more dynamic re-routing including changing shapes, and creating new stops, routes and trips on the fly.
We would not be able to match while it is on the detour. The vehicle state could reflect it is on a detour so would avoid it being made unpredictable because of N bad matches.
Just wanted to update this thread - the most recent proposal for Service Changes / detours in GTFS-realtime that we seem to have a general consensus on is: http://bit.ly/gtfs-service-changes-v3_1
It's linked at the very bottom of the thread that @nselikoff linked to above (https://github.com/google/transit/issues/113#issuecomment-519631364).
If we take it that we know about a diversion (either by detection or service changes) how do we represent this in TheTransitClock.
Do we try to update the current in-memory schedule on the fly or do we add a detour model layer that we can query before we take into account each stoppath travel time and dwell time in a prediction?
So, if stoppath is effected by detour add detour total travel times/dwell times to the predictions for stops passed the detour.
Also, do we represent the detour in the realtime feeds (service changes) coming from TheTransitClock? and provide predictions for the new stops on the detour?
and provide predictions for the new stops on the detour?
This would be amazing if possible.
How is matching affected? How does this affect the SpatialMatcher and the TemporalMatcher?
The current SpatialMatcher matches to the closest point on the static route. This would need to be changed so it could match to a point on the detour as well as the static route.
The TemporalMatcher would also need to say so it is possible to be on the detour based on the previous match and the time past.
Sounds silly to say it but detours cannot have detours. One detour would replace another.
Started work on branch tc_issue_152.
Focusing on GTFS-NewShapes piece of GTFS-rt Service Changes first.
@vsperez There are new bindings for GTFS-realtime that include the service changes at https://github.com/MobilityData/gtfs-realtime-bindings/tree/service-changes
This project may help with creating a test service changes feed. https://github.com/OneBusAway/onebusaway-gtfs-realtime-exporter/wiki
@scrudden It is already working the first version for dummy feeds. Just a few things to improve.
@vsperez That looks good! @barbeau Does the above format look correct to you?
By the way. The whole trip-update message is:
header { gtfs_realtime_version: "2.0" incrementality: FULL_DATASET timestamp: 1585441896 } entity { id: "/Volumes/VPEREZ/transitClockTests/B_R_NORMAL_2020.kml" shape { shape_id: "/Volumes/VPEREZ/transitClockTests/B_R_NORMAL_2020.kml" shape_point { shape_pt_lat: -22.480377 shape_pt_lon: -68.93063 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.481073 shape_pt_lon: -68.93209 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.479685 shape_pt_lon: -68.932526 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.478619 shape_pt_lon: -68.93287 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.477558 shape_pt_lon: -68.9332 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.4765 shape_pt_lon: -68.93354 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.476067 shape_pt_lon: -68.93367 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.475283 shape_pt_lon: -68.93391 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474318 shape_pt_lon: -68.93389 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474365 shape_pt_lon: -68.932625 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474367 shape_pt_lon: -68.93257 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474384 shape_pt_lon: -68.932014 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474394 shape_pt_lon: -68.93176 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474422 shape_pt_lon: -68.93085 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474434 shape_pt_lon: -68.93073 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474447 shape_pt_lon: -68.930084 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474468 shape_pt_lon: -68.92921 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474497 shape_pt_lon: -68.927895 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.474499 shape_pt_lon: -68.927795 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.47399 shape_pt_lon: -68.92762 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.473207 shape_pt_lon: -68.92735 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.472788 shape_pt_lon: -68.9272 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.47185 shape_pt_lon: -68.9269 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.47037 shape_pt_lon: -68.92641 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.468971 shape_pt_lon: -68.92592 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.467407 shape_pt_lon: -68.92533 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.467194 shape_pt_lon: -68.925285 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.46515 shape_pt_lon: -68.925446 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.4644 shape_pt_lon: -68.92549 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.463263 shape_pt_lon: -68.92555 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.462725 shape_pt_lon: -68.925606 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.461973 shape_pt_lon: -68.925674 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.460726 shape_pt_lon: -68.92582 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.460371 shape_pt_lon: -68.92585 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.459112 shape_pt_lon: -68.925964 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45822 shape_pt_lon: -68.92607 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45682 shape_pt_lon: -68.926186 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457085 shape_pt_lon: -68.92715 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.4572 shape_pt_lon: -68.92757 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45759 shape_pt_lon: -68.928986 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458092 shape_pt_lon: -68.92887 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458202 shape_pt_lon: -68.92884 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458307 shape_pt_lon: -68.92929 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458357 shape_pt_lon: -68.9295 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458399 shape_pt_lon: -68.9297 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458534 shape_pt_lon: -68.930176 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458721 shape_pt_lon: -68.930824 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458462 shape_pt_lon: -68.93097 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.458187 shape_pt_lon: -68.93109 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45792 shape_pt_lon: -68.93119 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457706 shape_pt_lon: -68.93127 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457727 shape_pt_lon: -68.93206 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457735 shape_pt_lon: -68.932304 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457739 shape_pt_lon: -68.93242 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457754 shape_pt_lon: -68.93282 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457775 shape_pt_lon: -68.93337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457783 shape_pt_lon: -68.93362 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.457499 shape_pt_lon: -68.933624 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45686 shape_pt_lon: -68.93366 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.456259 shape_pt_lon: -68.9337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.45618 shape_pt_lon: -68.9337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.456104 shape_pt_lon: -68.9337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.454697 shape_pt_lon: -68.933716 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.454609 shape_pt_lon: -68.933716 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.453234 shape_pt_lon: -68.9337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.453144 shape_pt_lon: -68.9337 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.452942 shape_pt_lon: -68.933685 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.452467 shape_pt_lon: -68.933624 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.451248 shape_pt_lon: -68.93338 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.449978 shape_pt_lon: -68.93312 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.448755 shape_pt_lon: -68.93286 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.447493 shape_pt_lon: -68.9326 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.44645 shape_pt_lon: -68.93238 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.445868 shape_pt_lon: -68.93227 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.444475 shape_pt_lon: -68.93197 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.443083 shape_pt_lon: -68.931725 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.44294 shape_pt_lon: -68.93169 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.441553 shape_pt_lon: -68.9314 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.440138 shape_pt_lon: -68.9311 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438698 shape_pt_lon: -68.9308 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43883 shape_pt_lon: -68.93009 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438969 shape_pt_lon: -68.92931 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439102 shape_pt_lon: -68.928566 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439234 shape_pt_lon: -68.92782 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439365 shape_pt_lon: -68.92708 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43944 shape_pt_lon: -68.92659 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439463 shape_pt_lon: -68.92648 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438433 shape_pt_lon: -68.92628 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438398 shape_pt_lon: -68.92619 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43838 shape_pt_lon: -68.92612 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438406 shape_pt_lon: -68.92599 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438717 shape_pt_lon: -68.92425 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438948 shape_pt_lon: -68.923 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439056 shape_pt_lon: -68.92234 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439217 shape_pt_lon: -68.92148 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439217 shape_pt_lon: -68.92136 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439207 shape_pt_lon: -68.92133 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439182 shape_pt_lon: -68.92126 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439152 shape_pt_lon: -68.921196 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.439102 shape_pt_lon: -68.92118 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438807 shape_pt_lon: -68.92112 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43804 shape_pt_lon: -68.92097 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.437927 shape_pt_lon: -68.920944 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.436739 shape_pt_lon: -68.92071 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.436247 shape_pt_lon: -68.92063 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435566 shape_pt_lon: -68.92049 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435114 shape_pt_lon: -68.92038 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43442 shape_pt_lon: -68.92022 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.434334 shape_pt_lon: -68.92021 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.434582 shape_pt_lon: -68.9189 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435024 shape_pt_lon: -68.91656 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435019 shape_pt_lon: -68.91653 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43501 shape_pt_lon: -68.9165 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435 shape_pt_lon: -68.91648 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.434969 shape_pt_lon: -68.91645 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.434513 shape_pt_lon: -68.91633 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.435064 shape_pt_lon: -68.91391 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.436483 shape_pt_lon: -68.91231 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.437096 shape_pt_lon: -68.91204 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.437555 shape_pt_lon: -68.91153 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.438286 shape_pt_lon: -68.91075 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43893 shape_pt_lon: -68.910065 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.440039 shape_pt_lon: -68.90882 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.441061 shape_pt_lon: -68.907745 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.442171 shape_pt_lon: -68.90653 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.443268 shape_pt_lon: -68.90533 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.443768 shape_pt_lon: -68.90481 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.443863 shape_pt_lon: -68.90472 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.443264 shape_pt_lon: -68.90175 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.44203 shape_pt_lon: -68.89527 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.441416 shape_pt_lon: -68.89227 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.440672 shape_pt_lon: -68.88846 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.440424 shape_pt_lon: -68.887146 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43883 shape_pt_lon: -68.878685 shape_dist_traveled: 0.0 } shape_point { shape_pt_lat: -22.43656 shape_pt_lon: -68.86694 shape_dist_traveled: 0.0 } } } entity { id: "01/Volumes/VPEREZ/transitClockTests/B_R_NORMAL_2020.kml" trip_update { trip { trip_id: "01" start_time: "15:17:00" start_date: "20200328" } trip_properties { shape_id: "/Volumes/VPEREZ/transitClockTests/B_R_NORMAL_2020.kml" } } }
@vsperez Could you publish the KML file you used and the related GTFS file somewhere?
@scrudden Yes! Although I believe there should be a shape_pt_sequence
field as well for an explicit reference to point order (similar to static GTFS). I just updated the bindings PR to include this new field.
Oh, and shape_dist_traveled
should be populated with a valid value instead of 0.0
. It's optional, so you could also just not publish the field.
Ok. Thanks for the feedback. Actually the lack of thouse fields is a bug. They are supposed to be there.
El lun., 30 de mar. de 2020 14:09, Sean Barbeau notifications@github.com escribió:
Oh, and shape_dist_traveled should be populated with a valid value instead of 0.0.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheTransitClock/transitime/issues/152#issuecomment-606125408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUAAGH2E7CKEAPU5XYIBK3RKDG6HANCNFSM4IXPVJQQ .
@scrudden I just fixed the shape_dist_traveled and shapeId. This is what I got. Is it correct the gtfs version, or should I use other? header { gtfs_realtime_version: "2.0" incrementality: FULL_DATASET timestamp: 1585697422 } entity { id: "B_R" shape { shape_id: "B_R" shape_point { shape_pt_lat: -22.480377 shape_pt_lon: -68.93063 shape_dist_traveled: 0.0 shape_pt_sequence: 1 } shape_point { shape_pt_lat: -22.481073 shape_pt_lon: -68.93209 shape_dist_traveled: 168.41592 shape_pt_sequence: 2 } shape_point { shape_pt_lat: -22.479685 shape_pt_lon: -68.932526 shape_dist_traveled: 328.73862 shape_pt_sequence: 3 } shape_point { shape_pt_lat: -22.478619 shape_pt_lon: -68.93287 shape_dist_traveled: 451.74484 shape_pt_sequence: 4 } shape_point { shape_pt_lat: -22.477558 shape_pt_lon: -68.9332 shape_dist_traveled: 573.9207 shape_pt_sequence: 5 } shape_point { shape_pt_lat: -22.4765 shape_pt_lon: -68.93354 shape_dist_traveled: 696.1834 shape_pt_sequence: 6 } shape_point { shape_pt_lat: -22.476067 shape_pt_lon: -68.93367 shape_dist_traveled: 746.0368 shape_pt_sequence: 7 } shape_point { shape_pt_lat: -22.475283 shape_pt_lon: -68.93391 shape_dist_traveled: 836.27966 shape_pt_sequence: 8 } shape_point { shape_pt_lat: -22.474318 shape_pt_lon: -68.93389 shape_dist_traveled: 943.25885 shape_pt_sequence: 9 } shape_point { shape_pt_lat: -22.474365 shape_pt_lon: -68.932625 shape_dist_traveled: 1073.3514 shape_pt_sequence: 10 } shape_point { shape_pt_lat: -22.474367 shape_pt_lon: -68.93257 shape_dist_traveled: 1079.4132 shape_pt_sequence: 11 } shape_point { shape_pt_lat: -22.474384 shape_pt_lon: -68.932014 shape_dist_traveled: 1136.0211 shape_pt_sequence: 12 } shape_point { shape_pt_lat: -22.474394 shape_pt_lon: -68.93176 shape_dist_traveled: 1162.115 shape_pt_sequence: 13 } shape_point { shape_pt_lat: -22.474422 shape_pt_lon: -68.93085 shape_dist_traveled: 1256.3247 shape_pt_sequence: 14 } shape_point { shape_pt_lat: -22.474434 shape_pt_lon: -68.93073 shape_dist_traveled: 1267.7863 shape_pt_sequence: 15 } shape_point { shape_pt_lat: -22.474447 shape_pt_lon: -68.930084 shape_dist_traveled: 1334.5416 shape_pt_sequence: 16 } shape_point { shape_pt_lat: -22.474468 shape_pt_lon: -68.92921 shape_dist_traveled: 1424.6129 shape_pt_sequence: 17 } shape_point { shape_pt_lat: -22.474497 shape_pt_lon: -68.927895 shape_dist_traveled: 1559.8712 shape_pt_sequence: 18 } shape_point { shape_pt_lat: -22.474499 shape_pt_lon: -68.927795 shape_dist_traveled: 1569.7303 shape_pt_sequence: 19 } shape_point { shape_pt_lat: -22.47399 shape_pt_lon: -68.92762 shape_dist_traveled: 1628.9928 shape_pt_sequence: 20 } shape_point { shape_pt_lat: -22.473207 shape_pt_lon: -68.92735 shape_dist_traveled: 1719.7773 shape_pt_sequence: 21 } shape_point { shape_pt_lat: -22.472788 shape_pt_lon: -68.9272 shape_dist_traveled: 1768.9058 shape_pt_sequence: 22 } shape_point { shape_pt_lat: -22.47185 shape_pt_lon: -68.9269 shape_dist_traveled: 1877.1558 shape_pt_sequence: 23 } shape_point { shape_pt_lat: -22.47037 shape_pt_lon: -68.92641 shape_dist_traveled: 2048.7993 shape_pt_sequence: 24 } shape_point { shape_pt_lat: -22.468971 shape_pt_lon: -68.92592 shape_dist_traveled: 2211.3406 shape_pt_sequence: 25 } shape_point { shape_pt_lat: -22.467407 shape_pt_lon: -68.92533 shape_dist_traveled: 2394.7463 shape_pt_sequence: 26 } shape_point { shape_pt_lat: -22.467194 shape_pt_lon: -68.925285 shape_dist_traveled: 2419.0793 shape_pt_sequence: 27 } shape_point { shape_pt_lat: -22.46515 shape_pt_lon: -68.925446 shape_dist_traveled: 2645.819 shape_pt_sequence: 28 } shape_point { shape_pt_lat: -22.4644 shape_pt_lon: -68.92549 shape_dist_traveled: 2729.206 shape_pt_sequence: 29 } shape_point { shape_pt_lat: -22.463263 shape_pt_lon: -68.92555 shape_dist_traveled: 2855.1682 shape_pt_sequence: 30 } shape_point { shape_pt_lat: -22.462725 shape_pt_lon: -68.925606 shape_dist_traveled: 2915.0474 shape_pt_sequence: 31 } shape_point { shape_pt_lat: -22.461973 shape_pt_lon: -68.925674 shape_dist_traveled: 2998.4062 shape_pt_sequence: 32 } shape_point { shape_pt_lat: -22.460726 shape_pt_lon: -68.92582 shape_dist_traveled: 3137.432 shape_pt_sequence: 33 } shape_point { shape_pt_lat: -22.460371 shape_pt_lon: -68.92585 shape_dist_traveled: 3176.8704 shape_pt_sequence: 34 } shape_point { shape_pt_lat: -22.459112 shape_pt_lon: -68.925964 shape_dist_traveled: 3316.746 shape_pt_sequence: 35 } shape_point { shape_pt_lat: -22.45822 shape_pt_lon: -68.92607 shape_dist_traveled: 3416.2375 shape_pt_sequence: 36 } shape_point { shape_pt_lat: -22.45682 shape_pt_lon: -68.926186 shape_dist_traveled: 3571.6 shape_pt_sequence: 37 } shape_point { shape_pt_lat: -22.457085 shape_pt_lon: -68.92715 shape_dist_traveled: 3675.0437 shape_pt_sequence: 38 } shape_point { shape_pt_lat: -22.4572 shape_pt_lon: -68.92757 shape_dist_traveled: 3720.0125 shape_pt_sequence: 39 } shape_point { shape_pt_lat: -22.45759 shape_pt_lon: -68.928986 shape_dist_traveled: 3872.0193 shape_pt_sequence: 40 } shape_point { shape_pt_lat: -22.458092 shape_pt_lon: -68.92887 shape_dist_traveled: 3928.7817 shape_pt_sequence: 41 } shape_point { shape_pt_lat: -22.458202 shape_pt_lon: -68.92884 shape_dist_traveled: 3941.5315 shape_pt_sequence: 42 } shape_point { shape_pt_lat: -22.458307 shape_pt_lon: -68.92929 shape_dist_traveled: 3989.153 shape_pt_sequence: 43 } shape_point { shape_pt_lat: -22.458357 shape_pt_lon: -68.9295 shape_dist_traveled: 4011.118 shape_pt_sequence: 44 } shape_point { shape_pt_lat: -22.458399 shape_pt_lon: -68.9297 shape_dist_traveled: 4033.0542 shape_pt_sequence: 45 } shape_point { shape_pt_lat: -22.458534 shape_pt_lon: -68.930176 shape_dist_traveled: 4083.8398 shape_pt_sequence: 46 } shape_point { shape_pt_lat: -22.458721 shape_pt_lon: -68.930824 shape_dist_traveled: 4153.396 shape_pt_sequence: 47 } shape_point { shape_pt_lat: -22.458462 shape_pt_lon: -68.93097 shape_dist_traveled: 4185.71 shape_pt_sequence: 48 } shape_point { shape_pt_lat: -22.458187 shape_pt_lon: -68.93109 shape_dist_traveled: 4218.5215 shape_pt_sequence: 49 } shape_point { shape_pt_lat: -22.45792 shape_pt_lon: -68.93119 shape_dist_traveled: 4249.956 shape_pt_sequence: 50 } shape_point { shape_pt_lat: -22.457706 shape_pt_lon: -68.93127 shape_dist_traveled: 4274.9697 shape_pt_sequence: 51 } shape_point { shape_pt_lat: -22.457727 shape_pt_lon: -68.93206 shape_dist_traveled: 4355.9224 shape_pt_sequence: 52 } shape_point { shape_pt_lat: -22.457735 shape_pt_lon: -68.932304 shape_dist_traveled: 4380.9897 shape_pt_sequence: 53 } shape_point { shape_pt_lat: -22.457739 shape_pt_lon: -68.93242 shape_dist_traveled: 4393.2173 shape_pt_sequence: 54 } shape_point { shape_pt_lat: -22.457754 shape_pt_lon: -68.93282 shape_dist_traveled: 4434.222 shape_pt_sequence: 55 } shape_point { shape_pt_lat: -22.457775 shape_pt_lon: -68.93337 shape_dist_traveled: 4491.3623 shape_pt_sequence: 56 } shape_point { shape_pt_lat: -22.457783 shape_pt_lon: -68.93362 shape_dist_traveled: 4515.715 shape_pt_sequence: 57 } shape_point { shape_pt_lat: -22.457499 shape_pt_lon: -68.933624 shape_dist_traveled: 4547.2866 shape_pt_sequence: 58 } shape_point { shape_pt_lat: -22.45686 shape_pt_lon: -68.93366 shape_dist_traveled: 4618.0527 shape_pt_sequence: 59 } shape_point { shape_pt_lat: -22.456259 shape_pt_lon: -68.9337 shape_dist_traveled: 4684.7104 shape_pt_sequence: 60 } shape_point { shape_pt_lat: -22.45618 shape_pt_lon: -68.9337 shape_dist_traveled: 4693.3477 shape_pt_sequence: 61 } shape_point { shape_pt_lat: -22.456104 shape_pt_lon: -68.9337 shape_dist_traveled: 4701.7637 shape_pt_sequence: 62 } shape_point { shape_pt_lat: -22.454697 shape_pt_lon: -68.933716 shape_dist_traveled: 4857.794 shape_pt_sequence: 63 } shape_point { shape_pt_lat: -22.454609 shape_pt_lon: -68.933716 shape_dist_traveled: 4867.4272 shape_pt_sequence: 64 } shape_point { shape_pt_lat: -22.453234 shape_pt_lon: -68.9337 shape_dist_traveled: 5019.694 shape_pt_sequence: 65 } shape_point { shape_pt_lat: -22.453144 shape_pt_lon: -68.9337 shape_dist_traveled: 5029.5576 shape_pt_sequence: 66 } shape_point { shape_pt_lat: -22.452942 shape_pt_lon: -68.933685 shape_dist_traveled: 5052.082 shape_pt_sequence: 67 } shape_point { shape_pt_lat: -22.452467 shape_pt_lon: -68.933624 shape_dist_traveled: 5105.051 shape_pt_sequence: 68 } shape_point { shape_pt_lat: -22.451248 shape_pt_lon: -68.93338 shape_dist_traveled: 5242.3945 shape_pt_sequence: 69 } shape_point { shape_pt_lat: -22.449978 shape_pt_lon: -68.93312 shape_dist_traveled: 5385.4785 shape_pt_sequence: 70 } shape_point { shape_pt_lat: -22.448755 shape_pt_lon: -68.93286 shape_dist_traveled: 5523.5093 shape_pt_sequence: 71 } shape_point { shape_pt_lat: -22.447493 shape_pt_lon: -68.9326 shape_dist_traveled: 5665.7607 shape_pt_sequence: 72 } shape_point { shape_pt_lat: -22.44645 shape_pt_lon: -68.93238 shape_dist_traveled: 5783.6025 shape_pt_sequence: 73 } shape_point { shape_pt_lat: -22.445868 shape_pt_lon: -68.93227 shape_dist_traveled: 5849.1045 shape_pt_sequence: 74 } shape_point { shape_pt_lat: -22.444475 shape_pt_lon: -68.93197 shape_dist_traveled: 6006.231 shape_pt_sequence: 75 } shape_point { shape_pt_lat: -22.443083 shape_pt_lon: -68.931725 shape_dist_traveled: 6162.5093 shape_pt_sequence: 76 } shape_point { shape_pt_lat: -22.44294 shape_pt_lon: -68.93169 shape_dist_traveled: 6178.7896 shape_pt_sequence: 77 } shape_point { shape_pt_lat: -22.441553 shape_pt_lon: -68.9314 shape_dist_traveled: 6335.106 shape_pt_sequence: 78 } shape_point { shape_pt_lat: -22.440138 shape_pt_lon: -68.9311 shape_dist_traveled: 6494.88 shape_pt_sequence: 79 } shape_point { shape_pt_lat: -22.438698 shape_pt_lon: -68.9308 shape_dist_traveled: 6657.2314 shape_pt_sequence: 80 } shape_point { shape_pt_lat: -22.43883 shape_pt_lon: -68.93009 shape_dist_traveled: 6731.397 shape_pt_sequence: 81 } shape_point { shape_pt_lat: -22.438969 shape_pt_lon: -68.92931 shape_dist_traveled: 6812.5645 shape_pt_sequence: 82 } shape_point { shape_pt_lat: -22.439102 shape_pt_lon: -68.928566 shape_dist_traveled: 6890.984 shape_pt_sequence: 83 } shape_point { shape_pt_lat: -22.439234 shape_pt_lon: -68.92782 shape_dist_traveled: 6968.6763 shape_pt_sequence: 84 } shape_point { shape_pt_lat: -22.439365 shape_pt_lon: -68.92708 shape_dist_traveled: 7046.167 shape_pt_sequence: 85 } shape_point { shape_pt_lat: -22.43944 shape_pt_lon: -68.92659 shape_dist_traveled: 7097.4565 shape_pt_sequence: 86 } shape_point { shape_pt_lat: -22.439463 shape_pt_lon: -68.92648 shape_dist_traveled: 7108.2114 shape_pt_sequence: 87 } shape_point { shape_pt_lat: -22.438433 shape_pt_lon: -68.92628 shape_dist_traveled: 7224.2285 shape_pt_sequence: 88 } shape_point { shape_pt_lat: -22.438398 shape_pt_lon: -68.92619 shape_dist_traveled: 7233.503 shape_pt_sequence: 89 } shape_point { shape_pt_lat: -22.43838 shape_pt_lon: -68.92612 shape_dist_traveled: 7241.8843 shape_pt_sequence: 90 } shape_point { shape_pt_lat: -22.438406 shape_pt_lon: -68.92599 shape_dist_traveled: 7255.3413 shape_pt_sequence: 91 } shape_point { shape_pt_lat: -22.438717 shape_pt_lon: -68.92425 shape_dist_traveled: 7437.003 shape_pt_sequence: 92 } shape_point { shape_pt_lat: -22.438948 shape_pt_lon: -68.923 shape_dist_traveled: 7568.0225 shape_pt_sequence: 93 } shape_point { shape_pt_lat: -22.439056 shape_pt_lon: -68.92234 shape_dist_traveled: 7636.668 shape_pt_sequence: 94 } shape_point { shape_pt_lat: -22.439217 shape_pt_lon: -68.92148 shape_dist_traveled: 7726.849 shape_pt_sequence: 95 } shape_point { shape_pt_lat: -22.439217 shape_pt_lon: -68.92136 shape_dist_traveled: 7739.2754 shape_pt_sequence: 96 } shape_point { shape_pt_lat: -22.439207 shape_pt_lon: -68.92133 shape_dist_traveled: 7741.9775 shape_pt_sequence: 97 } shape_point { shape_pt_lat: -22.439182 shape_pt_lon: -68.92126 shape_dist_traveled: 7750.453 shape_pt_sequence: 98 } shape_point { shape_pt_lat: -22.439152 shape_pt_lon: -68.921196 shape_dist_traveled: 7757.8174 shape_pt_sequence: 99 } shape_point { shape_pt_lat: -22.439102 shape_pt_lon: -68.92118 shape_dist_traveled: 7763.5176 shape_pt_sequence: 100 } shape_point { shape_pt_lat: -22.438807 shape_pt_lon: -68.92112 shape_dist_traveled: 7796.9214 shape_pt_sequence: 101 } shape_point { shape_pt_lat: -22.43804 shape_pt_lon: -68.92097 shape_dist_traveled: 7883.238 shape_pt_sequence: 102 } shape_point { shape_pt_lat: -22.437927 shape_pt_lon: -68.920944 shape_dist_traveled: 7895.992 shape_pt_sequence: 103 } shape_point { shape_pt_lat: -22.436739 shape_pt_lon: -68.92071 shape_dist_traveled: 8029.755 shape_pt_sequence: 104 } shape_point { shape_pt_lat: -22.436247 shape_pt_lon: -68.92063 shape_dist_traveled: 8084.83 shape_pt_sequence: 105 } shape_point { shape_pt_lat: -22.435566 shape_pt_lon: -68.92049 shape_dist_traveled: 8161.7954 shape_pt_sequence: 106 } shape_point { shape_pt_lat: -22.435114 shape_pt_lon: -68.92038 shape_dist_traveled: 8213.038 shape_pt_sequence: 107 } shape_point { shape_pt_lat: -22.43442 shape_pt_lon: -68.92022 shape_dist_traveled: 8291.58 shape_pt_sequence: 108 } shape_point { shape_pt_lat: -22.434334 shape_pt_lon: -68.92021 shape_dist_traveled: 8301.13 shape_pt_sequence: 109 } shape_point { shape_pt_lat: -22.434582 shape_pt_lon: -68.9189 shape_dist_traveled: 8438.544 shape_pt_sequence: 110 } shape_point { shape_pt_lat: -22.435024 shape_pt_lon: -68.91656 shape_dist_traveled: 8684.146 shape_pt_sequence: 111 } shape_point { shape_pt_lat: -22.435019 shape_pt_lon: -68.91653 shape_dist_traveled: 8687.701 shape_pt_sequence: 112 } shape_point { shape_pt_lat: -22.43501 shape_pt_lon: -68.9165 shape_dist_traveled: 8690.417 shape_pt_sequence: 113 } shape_point { shape_pt_lat: -22.435 shape_pt_lon: -68.91648 shape_dist_traveled: 8692.894 shape_pt_sequence: 114 } shape_point { shape_pt_lat: -22.434969 shape_pt_lon: -68.91645 shape_dist_traveled: 8697.657 shape_pt_sequence: 115 } shape_point { shape_pt_lat: -22.434513 shape_pt_lon: -68.91633 shape_dist_traveled: 8749.501 shape_pt_sequence: 116 } shape_point { shape_pt_lat: -22.435064 shape_pt_lon: -68.91391 shape_dist_traveled: 9004.947 shape_pt_sequence: 117 } shape_point { shape_pt_lat: -22.436483 shape_pt_lon: -68.91231 shape_dist_traveled: 9232.8955 shape_pt_sequence: 118 } shape_point { shape_pt_lat: -22.437096 shape_pt_lon: -68.91204 shape_dist_traveled: 9305.886 shape_pt_sequence: 119 } shape_point { shape_pt_lat: -22.437555 shape_pt_lon: -68.91153 shape_dist_traveled: 9378.804 shape_pt_sequence: 120 } shape_point { shape_pt_lat: -22.438286 shape_pt_lon: -68.91075 shape_dist_traveled: 9492.968 shape_pt_sequence: 121 } shape_point { shape_pt_lat: -22.43893 shape_pt_lon: -68.910065 shape_dist_traveled: 9593.283 shape_pt_sequence: 122 } shape_point { shape_pt_lat: -22.440039 shape_pt_lon: -68.90882 shape_dist_traveled: 9770.415 shape_pt_sequence: 123 } shape_point { shape_pt_lat: -22.441061 shape_pt_lon: -68.907745 shape_dist_traveled: 9928.155 shape_pt_sequence: 124 } shape_point { shape_pt_lat: -22.442171 shape_pt_lon: -68.90653 shape_dist_traveled: 10103.229 shape_pt_sequence: 125 } shape_point { shape_pt_lat: -22.443268 shape_pt_lon: -68.90533 shape_dist_traveled: 10276.707 shape_pt_sequence: 126 } shape_point { shape_pt_lat: -22.443768 shape_pt_lon: -68.90481 shape_dist_traveled: 10353.772 shape_pt_sequence: 127 } shape_point { shape_pt_lat: -22.443863 shape_pt_lon: -68.90472 shape_dist_traveled: 10367.692 shape_pt_sequence: 128 } shape_point { shape_pt_lat: -22.443264 shape_pt_lon: -68.90175 shape_dist_traveled: 10679.201 shape_pt_sequence: 129 } shape_point { shape_pt_lat: -22.44203 shape_pt_lon: -68.89527 shape_dist_traveled: 11358.277 shape_pt_sequence: 130 } shape_point { shape_pt_lat: -22.441416 shape_pt_lon: -68.89227 shape_dist_traveled: 11673.757 shape_pt_sequence: 131 } shape_point { shape_pt_lat: -22.440672 shape_pt_lon: -68.88846 shape_dist_traveled: 12074.34 shape_pt_sequence: 132 } shape_point { shape_pt_lat: -22.440424 shape_pt_lon: -68.887146 shape_dist_traveled: 12211.827 shape_pt_sequence: 133 } shape_point { shape_pt_lat: -22.43883 shape_pt_lon: -68.878685 shape_dist_traveled: 13098.807 shape_pt_sequence: 134 } shape_point { shape_pt_lat: -22.43656 shape_pt_lon: -68.86694 shape_dist_traveled: 14330.226 shape_pt_sequence: 135 } } } entity { id: "01B_R" trip_update { trip { trip_id: "01" start_time: "15:17:00" start_date: "20200328" } trip_properties { shape_id: "B_R" } } }
Looks good. I am not sure what is expected in terms of the version number. @barbeau Can you chime in on this?
Do you mean gtfs_realtime_version
? This will likely stay at "2.0"
in a final adoption of the GTFS-ServiceChanges spec, as the new entities don't break any existing behavior.
Yes, that is what I meant. @vsperez Is that what you meant by version in your earlier comment?
How would a stop on a detour be encoded using GTFS service changes? Should we relate a stop to the shape it is on?
Yes, I meant gtfs_realtime_version. Thanks.
How would a stop on a detour be encoded using GTFS service changes? Should we relate a stop to the shape it is on?
@scrudden I'm double-checking this, but here's my current understanding - If the stop_sequence of stops changes due to the detour (including added Stops
), you need to define a new Trip
object with all the StopTime
s and reference the new shape from here (and cancel the original scheduled trip via separate TripUpdate with schedule_relationship = CANCELED
). Think of this similar to defining new rows in the CSV files, but here as PB entities.
If the stop_sequence of stops does NOT change (e.g., no added stops, no change in stop pattern/geometry), then you can reference the new shape from the TripUpdate.trip_properties (trips that just have SKIPPED
stops are also ok in TripUpdates).
@barbeau How would OneBusAway deal with this new trip?
@scrudden None of the Trip
or other ServiceChanges entities are supported in OneBusAway yet, so it would just ignore it.
If on a detour this will effect the recording of arrival and departures. We should not record any for the skipped stops.
Is a detour a change to an existing trip or is it a completely new trip?
I am conflicted/confused on this one. The Services Changes spec would point to a new trip (if there is a stop on a detour) and the shape provided would be the whole new trip.
In my mind a detour is a change to an existing trip and the shape in a detour model would represent the changed piece of the route shape.
We will need to have the ability to handle stops on detours so have refactored the diversion model to include diversionStopPaths.
Indices class will need to be able to represent a vehicle on a diversion and where on a diversion it is.
https://github.com/google/transit/issues/113#issuecomment-485881848
@vsperez Just in case you have not seen. This comment from Trapeze describes a User Interface to draw a detour as you intend doing. This gives me confidence that this is an appropriate thing to do.
@scrudden, I have been taking a look at the detour managing, and I have a small issue. If the "basic detour" has a tripId on it is quite difficult to handle. I don't know what is better:
@vsperez Sorry, I do not understand your comment. Could you perhaps give an example?
@scrudden If I want to create a detour, I want to do it for several trips, even several days. In this very moment, the diversion PUT method receives: { "routeId": "string", "tripId": "string", "shapeId": "string", "startStopSeq": 0,....}
But If I am a user I would like to provide something like: { "routeId":"string", "since":"initDateTime","until":"endDateTime" ....}
So In this case, I a have a conflict between UI and operational data.
I think the issue is, should a detour be related to a route or to a trip?
Maybe we should have the option of both? So, if tripId is provided then have it specific to the trip but if routeId alone provided then apply detour to all trips on the route within the time period.
Does that sound like a plan?
Yes it does. I will make tripId optional.
Hi. I want to clarify the meaning of certain vars. Please let me know if it is correct.
What I need to do now is to build the detour given the route information (shape, stops, etc) and the alternative paths. Of course to build the alternative paths in the correct format. Please let me know if there is a class to build that easily. Regards Vicente
Hi Vicente,
The definition of the variables you detailed are correct.
There are detour model classes that you could populate. Is this what you are looking for?
Cheers, Sean.
Actually I am looking for some method that, given a coordinate and shape, returs the closest path or parths. One that would be easy to use. If not, I will implement it or search in the code. I know some exists, but the one I know are not easy to use.
El dom., 28 de junio de 2020 06:33, Sean Óg Crudden < notifications@github.com> escribió:
Hi Vicente,
The definition of the variables you detailed are correct.
There are detour model classes that you could populate. Is this what you are looking for?
Cheers, Sean.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheTransitClock/transitime/issues/152#issuecomment-650731470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUAAGCCWGXMLLFEZLC7MWTRY4L65ANCNFSM4IXPVJQQ .
Hi Vicente,
This may help. The Vector class has some of the methods that could help.
Cheers, Sean.
It will help, thanks.
El dom., 28 de jun. de 2020 a la(s) 11:07, Sean Óg Crudden ( notifications@github.com) escribió:
Hi Vicente,
This may help. The Vector class has some of the methods that could help.
Cheers, Sean.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheTransitClock/transitime/issues/152#issuecomment-650776693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUAAGCRX7BAAMNXHBHTQJ3RY5MDVANCNFSM4IXPVJQQ .
If there is a detour that is not in the GTFS schedule how should it be handled?
We would have to know it is there to be able to do something about it. So the question is how do we know it is there? If a vehicle goes on a detour it will, I presume, miss some of the normal stops for the trip. Can we detect this? Well, we can detect stops that have yet to have a vehicle pass it today. Does this indicate a detour? No, what about the first vehicle of the day. What if we say if no vehicles past it for the last X trips that were supported to pass it then it is a detour.
Oh, but to be a detour the vehicles must come back to the route. We will need to check this for the last X trips. We need to check that their next arrivals on the route are at the same stop.
So if we know the stop is detoured what should we do? Stop prediction passed this stop as we do not know how long the detour is? That's OK but the people waiting at the stops past the detour will not see any prediction for the vehicle so think it does not exist.
Just keep showing predictions as normal. This means that they will be incorrect for the passengers after the detour but at least the bus will exist. It will disappear though when it is on the detour as it will no longer match to the route.
The other option is to try and predict the travel time for the detour based on the time taken by the last X vehicles that took the detour.