Entity.ID formats


#1

Hi,
I’m new to this data set and am struggling to find what the components of the entity.id values are that are returned for Sydney buses. The GTFS data is quite well defined and documented but the GTFS Realtime, less so, especially when it comes to specifics.

For example :

entity {
id: “33553_15513509_2436_610X_1”
trip_update {
trip {
trip_id: “718492”
start_time: “17:22:00”
start_date: “20181214”
schedule_relationship: SCHEDULED
route_id: “2436_610X”
}

We know that the 2436 refers to the GTFS agency_id and the 610X to the route.

I believe the 33553 is the Bus Operator ID but would be good to have this confirmed.

What does the 15513509 refer to and the trailing _1 ?

We have similar “matching” data for the actual bus position;

entity {
id: “33553_15513509_2436_610X_1”
vehicle {
trip {
trip_id: “718492”
start_time: “17:22:00”
start_date: “20181214”
schedule_relationship: SCHEDULED
route_id: “2436_610X”
}
position {
latitude: -33.72525
longitude: 151.007584
bearing: 302
speed: 13.2
}
timestamp: 1544774008
congestion_level: UNKNOWN_CONGESTION_LEVEL
vehicle {
id: “33553_15513509_2436_610X_1”
1999: “\b\001\020\001\032!Scania~K280UB~Custom Coaches~CB60(\000”
}
occupancy_status: FEW_SEATS_AVAILABLE
}
}

So we have the vehicle position information and the vehicle.id

Any pointers as to what the vehicle.1999 string format is ?

Thanks,
Andy


#2

Hi @andymacjones, our buses real-time technical document describes how the entity ID is produced and what values it’s made up of.

Thanks,
Alex


#3

Thanks Alex - looks good. I’ve not seen this updated version before. Has it only just been published as I the one I’ve seen online is an older one.


#4

One comment I’d make Immediatley - in the spec (6.2) for Vehicle Position the id field is defined as int32 when it’s a string:

OperatorID_TODISTRIPID_TodisContractID_TodisRouteID_TripInstanceNumber

cheers
Andy


#5

Hi @andymacjones, thanks for letting us know, we’ll update the doc. We did update the document recently but don’t think we changed the entity ID section.

Thanks,
Alex


#6

Hi,

We have identified where all of the components of the Vehicle.ID come from (for example) apart from the second block of TodisTRIPID.

33553_15513509_2436_610X_1

Further investigation on a set of data from 14th December 2018 shows that at time of request there were 16 vehicles returned from GTFSR on the 610X route and the only characters that change on the Vehicle.ID are the last 3 characters of this second block (ignoring the final trip instance number).

Trip Start Time Vehicle Id
16:59:00 33553_15513240_2436_610X_1
17:22:00 33553_15513509_2436_610X_1
17:32:00 33553_15513512_2436_610X_1
17:40:00 33553_15513717_2436_610X_1
17:52:00 33553_15513206_2436_610X_1
18:09:00 33553_15513511_2436_610X_1
18:19:00 33553_15513503_2436_610X_1
18:19:00 33553_15513503_2436_610X_2
18:28:00 33553_15513250_2436_610X_1
18:39:00 33553_15513252_2436_610X_1
18:49:00 33553_15513253_2436_610X_1
19:09:00 33553_15513254_2436_610X_1
19:19:00 33553_15513719_2436_610X_1

What is interesting is that whilst it’s sequential it’s not contiguous and it appears to “wrap” so we go 240,509,512,717 but then back to 206, 511, 503 (503 again), then 250,252, 253, 254, 719.

Where is this TodisTRIPID generated from ? Is it derived from another value ? 15513 doesn’t seem to tie up to anything useful. Even a PosIX value of 1551324000 to match the “date” part gives us 28th Feb 2019.

On the two records that have the _1, _2 trip instance numbers we can see that they have exactly the same Vehicle.ID as each other (apart from the instance number).

Would be massively grateful if somebody can explain where these two parts come from that make up the TodisTripID.


#7

I don’t think the TODIS trip ID is supposed to give you anything useful. As far as I’m aware, it’s just another sequentially allocated identifier to identify the trip. The TODIS trip ID is not unique to the route, so you might find that 15513503 is for a 610X service but 15513504 might be for another route or a service that doesn’t run that day.

For example (I’m looking at November data here), here are three sequentially allocated TODIS IDs:

  • 33553_12813003_2436_M61_1
  • 33553_12813004_2436_610X_1
  • 33553_12813005_2436_M61_1

As you’ve pointed out, the _1, _2 suffix is the TripInstanceNumber. For the bus feed, the vehicle ID isn’t really a identifier for the vehicle – it’s just another identifier of the trip. There’s no way of tracking a vehicle across the network, if that’s what you’re after.

As to why there might be two trip instances… it usually happens when two drivers log into the same trip from the driver console. The number allows the two trips to be differentiated (although, the trip instance number isn’t necessarily persistant throughout the lifecycle of a trip).


#8

in case you are making a global app, i have seen cases (in LA i think) where they run multiple vehicles for a single GTFS trip ID, so while they appear as duplicates in the GTFS-realtime, they are all servicing the same trip. Staggering the services would make sense to me, but I’m sure they have their reasons.