vehicle_id in v2 API

32 views
Skip to first unread message

Andy Monat

unread,
Dec 1, 2016, 11:13:06 PM12/1/16
to massdotd...@googlegroups.com
Hi,

It looks like the vehicle_id field for subway and bus in the v2 API no longer correspond to the numbers you see on the vehicles. For instance, there's a Green Line B train with vehicle_id 10102, a Red Line train with vehicle_id 544A3F40, and a 1 bus with vehicle_id y2195. I know at least for the Green Line these used to match the numbers on the vehicles, like 3840 or similar.

Is this a bug?

Thanks!
Andy

Developer at MBTA

unread,
Dec 2, 2016, 12:22:40 PM12/2/16
to massdotd...@googlegroups.com
Hi Andy,

Thanks for this report. It's not a bug, more like a feature that partially went into production too early. Our plan is as follows: We will add a new field, "vehicle_label", to the API. This field corresponds with the label field in GTFS-realtime, and represents the ID numbers that you see on the outside of vehicles. In the case of buses, it will be the number shown on the bus. For Red, Orange, and Blue Line trains, it will be the number shown on the lead car of the train. For Green Line trains, we will include all cars in the consist, in order from front to back, separated by dashes. So for example a train with cars 3858 and 3746 would be represented by the string "3858-3746."

At the same time that we roll out this new label field, we will also change the vehicle_id field to be a unique identifier that increments throughout the day. These will be unique over the course of a single day. As you noticed, we accidentally rolled out this portion of the change too early. We are in the process of reverting it for now, until we are prepared to add the label field.

Please note: Red, Orange and Blue Line trains have been using the vehicle_id values similar to 544A3F40 for several months now, and that change will not be rolled back. The accidental change from this week only affected Green Line.

Sincerely,

Developer@MBTA

Edit: the change only affected Green Line, bus was never affected. No change to vehicle_id is expected for bus.

Stefan W

unread,
Dec 2, 2016, 12:52:54 PM12/2/16
to massdotd...@googlegroups.com
This is great news! How much advance notice will you be able to give us about the addition of "vehicle_label"?

Also, will it be for all routes in the API? Commuter Rail included?

Thanks!!


-- S




> On Dec 2, 2016, at 12:22 PM, Developer at MBTA <deve...@mbta.com> wrote:
>
> Hi Andy,
>
> Thanks for this report. It's not a bug, more like a feature that partially went into production too early. Our plan is as follows: We will add a new field, "vehicle_label", to the API. This field corresponds with the label field in GTFS-realtime, and represents the ID numbers that you see on the outside of vehicles. In the case of buses, it will be the number shown on the bus. For Red, Orange, and Blue Line trains, it will be the number shown on the lead car of the train. For Green Line trains, we will include all cars in the consist, in order from front to back, separated by dashes. So for example a train with cars 3858 and 3746 would be represented by the string "3858-3746."
>
> At the same time that we roll out this new label field, we will also change the vehicle_id field to be a unique identifier that increments throughout the day. These will be unique over the course of a single day. As you noticed, we accidentally rolled out this portion of the change too early. We are in the process of reverting it for now, until we are prepared to add the label field.
>
> Please note: Red, Orange and Blue Line trains have been using the vehicle_id values similar to 544A3F40 for several months now, and that change will not be rolled back. The accidental change from this week only affected bus and Green Line.
>
> Sincerely,
>
> Developer@MBTA

Patrick Greenwell

unread,
Dec 2, 2016, 1:34:03 PM12/2/16
to MBTA Developers
Unique in the sense that each trip will have a a unique vehicle_id for that day or unique in that each consist/trainset/bus operated by a crew will have a unique id for the duration of the trips that they run that day?  Also will this change be made to the GTFS-realtime(.pb) feeds as well?

Thanks, 

- Patrick


On Friday, December 2, 2016 at 9:22:40 AM UTC-8, Developer at MBTA wrote:
Hi Andy,

Thanks for this report. It's not a bug, more like a feature that partially went into production too early. Our plan is as follows: We will add a new field, "vehicle_label", to the API. This field corresponds with the label field in GTFS-realtime, and represents the ID numbers that you see on the outside of vehicles. In the case of buses, it will be the number shown on the bus. For Red, Orange, and Blue Line trains, it will be the number shown on the lead car of the train. For Green Line trains, we will include all cars in the consist, in order from front to back, separated by dashes. So for example a train with cars 3858 and 3746 would be represented by the string "3858-3746."

At the same time that we roll out this new label field, we will also change the vehicle_id field to be a unique identifier that increments throughout the day. These will be unique over the course of a single day. As you noticed, we accidentally rolled out this portion of the change too early. We are in the process of reverting it for now, until we are prepared to add the label field.

Please note: Red, Orange and Blue Line trains have been using the vehicle_id values similar to 544A3F40 for several months now, and that change will not be rolled back. The accidental change from this week only affected bus and Green Line.

Sincerely,

Developer@MBTA

Developer at MBTA

unread,
Dec 2, 2016, 2:43:14 PM12/2/16
to MBTA Developers
Stefan: Commuter rail trains will have a "vehicle_label" which is the ID of the control cab car. This is what you currently see in the "vehicle_id" field, and the vehicle_id field will remain as it is now for CR.

Patrick: The goal is that when a consist is put together and placed in service, it gets a "vehicle_id" which remains constant throughout the day, until that vehicle goes out of service. Due to technical constraints, a Green Line vehicle may occasionally be assigned a new ID even when it is in the middle of service. We hope to keep instances of this to a minimum. This discussion really applies mainly to the Red/Orange/Blue/Green Lines; other modes will keep their current behaviors in the vehicle_id field.

Note to all: Bus and commuter rail will keep the same vehicle_ids that they currently have. Vehicle_label for bus will be the vehicle_id without the leading "y" character. Commuter rail vehicle_label will exactly match the vehicle_id. This change is primarily affecting Green Line, where you'll be getting the full consist, and Red/Orange/Blue lines, where we had already changed the vehicle_id values, and will now be returning the lead-car values to the API via the new field.

We'll make a separate post summarizing this change. We will give a heads-up at least a week in advance of deploying this change to production.

Sincerely,

Developer@MBTA

Stefan W

unread,
Dec 2, 2016, 4:08:53 PM12/2/16
to massdotd...@googlegroups.com
Quite excellent! I'm thrilled!!

It's not essential but it would be handy to have this new field mentioned in a documentation update. Definitely a nice-to-have, not a must-have.

(Apologies if you were already planning on updating the docs.)

Thanks again!


-- Stefan

Reply all
Reply to author
Forward
0 new messages