From 4fee7f658a797a524f78af27f3a9fdddcad84688 Mon Sep 17 00:00:00 2001 From: Sean Barbeau Date: Thu, 24 Sep 2020 10:34:26 -0400 Subject: [PATCH] fix: Define defaults for VehiclePosition occupancy percentage and status Closes #247 --- gtfs-realtime/proto/gtfs-realtime.proto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index ae914ad35..b6d465eff 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -437,18 +437,19 @@ message VehiclePosition { } // If multi_carriage_status is populated with per-carriage OccupancyStatus, // then this field should describe the entire vehicle with all carriages accepting passengers considered. - optional OccupancyStatus occupancy_status = 9; + optional OccupancyStatus occupancy_status = 9 [default = NO_DATA_AVAILABLE]; // A percentage value representing the degree of passenger occupancy of the vehicle. // The values are represented as an integer without decimals. 0 means 0% and 100 means 100%. // The value 100 should represent the total maximum occupancy the vehicle was designed for, // including both seated and standing capacity, and current operating regulations allow. // It is possible that the value goes over 100 if there are currently more passengers than what the vehicle was designed for. + // -1 in case data is not available for this vehicle (as protobuf defaults to 0 otherwise). // The precision of occupancy_percentage should be low enough that you can't track a single person boarding and alighting for privacy reasons. // If multi_carriage_status is populated with per-carriage occupancy_percentage, // then this field should describe the entire vehicle with all carriages accepting passengers considered. // This field is still experimental, and subject to change. It may be formally adopted in the future. - optional uint32 occupancy_percentage = 10; + optional int32 occupancy_percentage = 10 [default = -1]; // Carriage specific details, used for vehicles composed of several carriages // This message/field is still experimental, and subject to change. It may be formally adopted in the future.