CUTR-at-USF / transit-feed-quality-calculator

A tool that uses the gtfs-realtime-validator to calculate the quality of a large number of GTFS-realtime feeds
Other
7 stars 1 forks source link

Add TransitlandDownloader to retrieve GTFS/GTFS-realtime feeds from Transitland #4

Open barbeau opened 6 years ago

barbeau commented 6 years ago

Transitland doesn't yet include URLs for GTFS-realtime feeds, but it's on the short list - see https://github.com/transitland/transitland/issues/77.

This project is written to be fairly agnostic to what API the GTFS and GTFS-realtime feed URLs come from. We're currently using TransitFeeds.com because it already has a directory of GTFS-realtime feeds, but I'd like to add Transitland as an option too.

Adding Transitland as an option to our project would mean mirroring the TransitFeedsDownloader class in a new TransitlandDownloader class.

TransitFeedsDownloader does the following:

  1. Gets a list of GTFS-realtime feeds from TransitFeeds.com, which each have a Location ID (defined by TransitFeeds.com), creates a subdirectory for that Location ID, and downloads the GTFS-realtime protocol buffer files for each URL to that directory
  2. Gets a list of GTFS feeds, and downloads each GTFS zip file if we have a corresponding GTFS-realtime feed for that same Location ID

So, we'd need to following a similar process for Transitland:

  1. Get a list of GTFS-realtime feed URLs, each of which has some identifier that links it to the corresponding GTFS data
  2. Get a list of GTFS feeds, each of which has some identifier that links it to the corresponding GTFS-realtime feeds

This could happen in a single API call, or several - the main requirement is that there is a link between the GTFS and GTFS-realtime feeds, and that we can easily download GTFS data only for agencies that have GTFS-realtime feeds. Note that GTFS-realtime feeds typically have 2-3 URLs, one for each TripUpdate, VehiclePositions, and ServiceAlerts.

barbeau commented 6 years ago

This new downloader should extend our BaseDownloader class.

barbeau commented 6 years ago

Note that as of the beginning of 2018 Mapzen is shutting down, but Transitland will continue throughout 2018 for now: https://mapzen.com/blog/migration/

Before implementing this we should check on the latest status of Transitland.