Caltrain GTFS/NeTEx stops don't have parent IDs

49 views
Skip to first unread message

Daniel Lo Nigro

unread,
Jul 27, 2021, 1:42:41 PM7/27/21
to 511sfbaydevel...@googlegroups.com

Hi!

 

I’ve noticed that the Caltrain GTFS stop data file does not have any values for direction nor platform_code, and the NeTEx data is also missing the <PlatformCode> field, so for a given station it’s not easily possible to tell which one represents the northbound platform vs the southbound platform. They’re also missing a ParentStation to tie the two together so I’d have to rely on matching them by name, which is fragile.

 

Are these issues just due to data quality issues in the upstream Caltrain GTFS data? I’ve noticed various issues with their GTFS feeds over the years.

 

Thanks!

 

 

Daniel Lo Nigro — Front End Engineer
e: da...@fb.com    fb: http://facebook.com/daaniel   
1 Hacker Way, Menlo Park, CA 94025

 

Kapeel Daryani

unread,
Jul 27, 2021, 2:28:43 PM7/27/21
to 511sfbaydevel...@googlegroups.com

Hi Daniel,

 

The GTFS specification doesn’t allow directions to be provided in stops.txt file. Directions are associated only with the trips data and can be found in trips.txt file. The direction information is further enhanced by providing more associated details in the GTFS+ file directions.txt. Secondly, platform_code or parent_station information in stops.txt file is an optional field and so Caltrain has opted out from providing these values.

 

Regards,

Kapeel Daryani.

 

From: 'Daniel Lo Nigro' via 511SFBayDeveloperResources <511sfbaydevel...@googlegroups.com>
Sent: Tuesday, July 27, 2021 10:43 AM
To: 511sfbaydevel...@googlegroups.com
Subject: [511SFBayDeveloperResources] Caltrain GTFS/NeTEx stops don't have parent 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/MW4PR15MB4539CFC95AA26CFBD602D385D9E99%40MW4PR15MB4539.namprd15.prod.outlook.com.

kdar...@bayareametro.gov

unread,
Jul 27, 2021, 6:36:10 PM7/27/21
to 511SFBayDeveloperResources
Hi Daniel, 

I just wanted to add here that 511 will work with Caltrain to provide additional information about the stops in GTFS feed.

Thank you for bringing this to our attention.  

Daniel Lo Nigro

unread,
Jul 28, 2021, 7:42:31 PM7/28/21
to 511SFBayDeveloperResources
Thank you Kapeel! :)

Years ago, Caltrain's data feed had both "stations" (location_type = 1) and "stops/platforms" (location_type = 0) which was very useful. I guess they switched to a different backend system at some point, and it broke a lot of that data. The changes I'd like to see are:

1. Add Northbound/Southbound or NB/SB to platform_code for stops so we can tell which platform is northbound vs southbound
2. Add stations (location_type = 1) in stops.txt, with the proper stop_ids (eg. CTMP for Menlo Park, CTPA for Palo Alto, etc)
3. Associate Stops/Platforms with the right station by updating parent_station field to contain the stop_id for the correct station

I found a copy of Caltrain's GTFS data as of 2017-04-10, and it had this all properly configured back then: https://gist.github.com/dwfreed/c59f1b13be8afc6ec338d5dc1d6f8567#file-stops-txt . The data back then was basically in a perfect, easy-to-consume format compared to the state of the stops.txt file today.

Thanks!
Daniel
Reply all
Reply to author
Forward
0 new messages