Conditional GTFS import
See original GitHub issueHello again,
This might sound stupid since I lack any real knowledge of GTFS, but I’m wondering if there’s any way to only import the GTFS fields that have a zone name with a specific prefix (either from an array of prefixes or a wildcard like ['Harju1', 'Harju2']
or Harju*
)?
Reason I’m asking is that the only GTFS available to me is country-wide (even though I specify my agency_key with the capital’s name, but the GTFS doesn’t seem to respect that really, using it in other town’s and cities’ routes, stops, etc.)
If not, then is it possible to use it as a mongoose find filter within my queries (the 3rd parameter as I understood)? This last question may be more suitable for StackOverflow, so feel free to close if the first option isn’t available and I’ll do my best to find a way to handle this on the query level.
BR, Andreas
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks for the details.
zone_name
doesn’t seem to be a standard field in GTFS - so it would be up to you to filter on this field. You could update the schema for stops: https://github.com/BlinkTagInc/node-gtfs/blob/master/models/gtfs/stop.js and maintain your own that supports the additional fields in your feed, such as “zone_name”. If these fields were defined in the schema, you could more easily query for them.Or, you could write a small pre-import script that went through the GTFS file and removed all of the stops, routes and stoptimes that you were not interested in and created a smaller GTFS file for you to import.
You can get all stoptimes for a specific stop id like: