Christmas buses now available in the buses feed


#1

Christmas buses are now available in the vehicle position data. The buses are identified in the feed by the ‘special_vehicle_attributes’ field. When it’s “=1” it is a Christmas bus, when “=0” it is not. Here’s an example:

entity {
  id: "33553_11466389_2436_607X_1"
  vehicle {
    trip {
      trip_id: "299400"
      start_time: "08:49:00"
      start_date: "20161209"
      schedule_relationship: SCHEDULED
      route_id: "2436_607X"
    }
    position {
      latitude: -33.7626571655
      longitude: 151.020309448
      bearing: 88.0
      speed: 22.7000007629
    }
    timestamp: 1481235603
    congestion_level: RUNNING_SMOOTHLY
    vehicle {
      id: "33553_11466389_2436_607X_1"
      [transit_realtime.tfnsw_vehicle_descriptor] {
        air_conditioned: true
        wheelchair_accessible: 1
        special_vehicle_attributes: 1
      }
    }
    occupancy_status: FEW_SEATS_AVAILABLE
  }

Feel free to post any questions you might have in this thread.

Thanks,
Alex


#2

Hey Alex,

Is there a special .proto file which will allow us to access these attributes?

edit: Answered my own question! This is the .proto file for buses – turns out I’ve been using the one for trains.


#3

hey @jxeeno and others… let us know if you are displaying the xmas buses anywhere please :christmas_tree:


#4

Hi, I am probably missing something, what are the values for special_vehicle_attributes? For example, 1 = Christmas bus. I can see value of special_vehicle_attributes = 2.


#5

Catch Wi-Fi, I believe.


#6

Cross-checking with NextThere, it would appear to be the case. :slight_smile:


#7

Thanks yet again. Hopefully Open Data has the complete list of the values. Also wondering what happens if it is a Christmas bus with catch wi-fi (permutation values? :slight_smile:)


#8

Purely speculation, but my guess is they might end up using bitwise operations, e.g.:

let CHRISTMAS_BUS = 1;
let CATCH_FREE_WIFI = 2;
let SOME_OTHER_ATTR = 4;

// both xmas bus and catch free wifi
CHRISTMAS_BUS | CATCH_FREE_WIFI // = 3

// both some attr and xmas bus
SOME_OTHER_ATTR | CHRISTMAS_BUS // = 5

// both catch free wifi and some other attr
CATCH_FREE_WIFI | SOME_OTHER_ATTR // = 6

// all attributes
CHRISTMAS_BUS | CATCH_FREE_WIFI | SOME_OTHER_ATTR // = 7

#9

Good tip… we’ll get this added to the documentation on one of our pages (maybe Tips and Troubleshooting)


#10

ha! so that’s exactly what they’ve done