GTFS-RT trip updates for MUNI and VTA have "offset" stop IDs

22 views
Skip to first unread message

Paul Bellora

unread,
Mar 17, 2021, 9:27:00 PM3/17/21
to 511SFBayDeveloperResources
Hi, I recently set up my app to start consuming trip updates for MUNI and VTA using the following feeds:


However, I've noticed something very strange: the stop IDs in these real-time feeds appear to be numerically offset from the corresponding static GTFS stop IDs. MUNI stop IDs are offset by 10k, e.g. stop "13024" in real-time seems to match stop "3024" in static GTFS. VTA stop IDs are offset by 60k, e.g. "60020" in real-time matches "20" in static.

Is this behavior expected and if so, why? I've coded a workaround but it feels so mysterious that I'm afraid it will change unexpectedly. I'm not aware of this issue with any other 511.org trip updates feeds.

Thanks,
Paul

Nisar Ahmed

unread,
Mar 17, 2021, 10:51:22 PM3/17/21
to 511sfbaydevel...@googlegroups.com

Hi Paul,

 

Thanks for reaching out. If you are receiving both GTFS and GTFS-Realtime Trip Updates both the 511 system, you should not be experiencing this. This issue will get presented when your static and real-time data sources are different.

 

511 system uses a regional stop code framework in order to create a unique stop IDs scheme across the entire region. I would recommend that you use the GTFS feeds from the api.511.org source using the http://api.511.org/transit/datafeeds?api_key={API_KEY}&operator_id={same value as the agency parameter used in the TripUpdates API}

 

--Nisar

 

From: 'Paul Bellora' via 511SFBayDeveloperResources <511sfbaydevel...@googlegroups.com>
Sent: Wednesday, March 17, 2021 6:27 PM
To: 511SFBayDeveloperResources <511sfbaydevel...@googlegroups.com>
Subject: [511SFBayDeveloperResources] GTFS-RT trip updates for MUNI and VTA have "offset" stop IDs

 

*External Email*

 

--
You received this message because you are subscribed to the Google Groups "511SFBayDeveloperResources" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 511sfbaydeveloperre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/511sfbaydeveloperresources/f4543206-f137-4f23-82ec-ca96f78f6ea6n%40googlegroups.com.

Kapeel Daryani

unread,
Mar 18, 2021, 11:44:05 AM3/18/21
to 511sfbaydevel...@googlegroups.com

Hi Paul,

 

What is your source of GTFS feeds? Could you please confirm if you are using 511 recommended datafeed API for the GTFS feeds. If not, following are the URLs to obtain GTFS feeds for both the agencies that will match with GTFS-RT:

Let us know if you still see the discrepancy in stopIDs.

 

Regards,

Kapeel Daryani.

 

From: 'Paul Bellora' via 511SFBayDeveloperResources <511sfbaydevel...@googlegroups.com>
Sent: Wednesday, March 17, 2021 6:27 PM
To: 511SFBayDeveloperResources <511sfbaydevel...@googlegroups.com>
Subject: [511SFBayDeveloperResources] GTFS-RT trip updates for MUNI and VTA have "offset" stop IDs

 

*External Email*

 

Hi, I recently set up my app to start consuming trip updates for MUNI and VTA using the following feeds:

--

Kapeel Daryani

unread,
Mar 18, 2021, 11:45:36 AM3/18/21
to 511sfbaydevel...@googlegroups.com

Paul Bellora

unread,
Mar 18, 2021, 12:23:37 PM3/18/21
to 511SFBayDeveloperResources
Hi Nisar and Kapeel, thanks for clarifying! You are correct, I'm not currently using 511's GTFS feeds for those agencies. I'll work on switching over. To help me transition some custom stop related code, are those "offsets" of 10k and 60k guaranteed to be stable, or are they subject to change?

Paul

Kapeel Daryani

unread,
Mar 18, 2021, 12:27:03 PM3/18/21
to 511sfbaydevel...@googlegroups.com

Hi Paul,

 

Once you start using 511 provided GTFS feeds there will be no concern of offset in stopIDs. They will match completely between GTFS and GTFS-RT feeds.

Nisar Ahmed

unread,
Mar 18, 2021, 12:29:26 PM3/18/21
to 511sfbaydevel...@googlegroups.com

In addition to Kapeel’s note below, change can happen at the operator end, which we don’t have any control over. If an operator decides to change its stop ID scheme, your assumption will not hold. But, we can ensure that the stop ID between GTFS and GTFS-RT, both sourced from 511, will always match.

 

--Nisar

Paul Bellora

unread,
Mar 18, 2021, 5:16:20 PM3/18/21
to 511SFBayDeveloperResources
Understood, thanks for explaining!
Reply all
Reply to author
Forward
0 new messages