fix: Define defaults for VehiclePosition occupancy percentage and status#248
fix: Define defaults for VehiclePosition occupancy percentage and status#248barbeau wants to merge 1 commit intogoogle:masterfrom
Conversation
|
Could you elaborate why this optional value needs an initialisation? If I would parse this feed without the value present, it would be just "not available". |
I have only active experience with C, Java and Python parsing, both obviously all support NULL, null and None, but that is not my point here. When I want to check for a stopTimeUpdate, I first have to ensure stopTimeUpdate.hasDeparture() for which languages are optional values in GTFS-RT not supporting this hasAttribute method? |
Yes, that's the issue here. We can't guarantee that all protobuf consuming software include methods like Here's one example for C# - MobilityData/gtfs-realtime-bindings#52. You can see this actually applies to other optional GTFS-realtime fields as well that we could fix, including bearing, speed, and vehicle stop status. |
|
I should also mention that this change will help developers new to protobufs that don't know they need to call |
How is that binding handling a missing Departure or Arrival then technically (kind of the basics when using GTFS-RT)? I honestly think this should not be solved by default values, rather the binding generator for C# should be fixed. |
|
Just a note, Capital Metro Austin will begin publishing occupancy_status in about 2 weeks, for our entire bus fleet. We are only choosing to publish CRUSHED_STANDING_ROOM_ONLY, FULL and NOT_ACCEPTING_PASSENGERS. When one of these values is not present, we do not include occupancy_status for that vehicle.
We have worked with our partners to display “Notice: Crowded Vehicle” if any of these three values are present. I will be reaching to other consumers to explain what we are doing and see if they want to provide the data that is available.
Thank you,
[http://www.capmetro.org/email/eSigLogo.png]<http://www.capmetro.org/>
Daryl Weinberg
Transit Systems Architect
[http://www.capmetro.org/email/sig_fb.png]<https://www.facebook.com/capitalmetro?_rdr=p> [http://www.capmetro.org/email/sig_tw.png] <https://twitter.com/CapMetroATX>
o: 512-369-6216
|
e: Daryl.Weinberg@capmetro.org<mailto:Daryl.Weinberg@capmetro.org>
|
w: capmetro.org<http://www.capmetro.org/>
From: Sean Barbeau <notifications@github.com>
Sent: Thursday, September 24, 2020 9:51 AM
To: google/transit <transit@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [google/transit] fix: Define defaults for VehiclePosition occupancy percentage and status (#248)
EXTERNAL E-MAIL
@skinkie<https://github.com/skinkie> Could you read #247<#247> and let me know if you still have questions? I explained it there.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#248 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFZNIRVRPDU6UUJOLPRFA6TSHNMGTANCNFSM4RYMMWNA>.
|
|
Yeah, I think I'm on the same page as @skinkie on this one. Even though it's not explicitly supported by proto2, it's implicitly a requirement for the bindings to support expressing optional values as null-like or have a |
The idea behind this proposal is that for the user, the occupancy of a vehicle several stops away (at its VehiclePosition) may be difficult to act upon, because occupancy will change by the time the vehicle arrives at the stop where the user intends to board. This new field allows agencies to provide expected occupancy for future stops. It is left open for agencies to decide how to calculate these occupancies, they may use any model provided it uses realtime data. There is no prohibition on providing data for past stops or for the last stop, although such data is not useful for the use case described. The natural place in GTFS for these occupancies is in TripUpdate.StopTimeUpdate - they are analogous to StopTimeEvents. One drawback is that the name StopTimeUpdate is potentially then slightly misleading because its data is not just about timing. If google#248 is adopted, that default would apply here as well.
|
I agree that generally there are workaround in the implementation to achieve the same behaviour. However since there's nothing in the spec that mention what is the actual default, we have a vendor that insist that they can not include the Adding a default value would clear that ambiguity. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This pull request has been closed due to inactivity. Pull requests can always be reopened after they have been closed. See the Specification Amendment Process. |
As discussed in #247, default values aren't currently defined for
VehiclePosition.occupancy_percentageandVehiclePosition.occupancy_status.This pull request adds defaults for
VehiclePosition.occupancy_percentageandVehiclePosition.occupancy_statusso erroneous defaults aren't read by GTFS-realtime consumers.TODO:
Fixes #247