afimb / gtfslib-python

An open source library in python for reading GTFS files and computing various stats and indicators about Public Transport networks
GNU General Public License v3.0
44 stars 6 forks source link

Rework GTFS export plugin filtering #51

Closed laurentg closed 7 years ago

laurentg commented 7 years ago

See #50 for more information.

laurentg commented 7 years ago

The support for filtering in the GTFS export plugin has never been fully tested and is currently buggy. The problem with filtering each object is that the semantics are not always the same between a GTFS export and the common sense. For example filtering stops on Route or Agency will list all stops from all stop_times; but this is not enough for a GTFS export as one need the parent station too. Joining on the parent station for the DAO would be brain-dead though.

The proper solution is to only use the provided filter for basic classes of object (agencies, routes, trips, stop times, stops, calendar, calendar_dates) and deriving the proper filter for the other objects based on the previous returned object lists (stop > parent stations, stops+stations > transfers, zones+routes > fares_attributes > fare_rules, etc...)

Josef-A commented 7 years ago

I do not have any fares in my feed. So I can't test that. An minor remark. If the output file is optional and empty. Would it be better to not save it at all?

laurentg commented 7 years ago

Good remark. I'll create an issue for that. See #53.