public-transport / gtfs-via-postgres

Process GTFS Static/Schedule by importing it into a PostgreSQL database.
https://github.com/derhuerst/gtfs-via-postgres#gtfs-via-postgres
Other
88 stars 17 forks source link

Add support for fare_leg_rules.txt #42

Open langbein-daniel opened 1 year ago

langbein-daniel commented 1 year ago

Feature request: Support import of fare_leg_rules.txt

Please don't see this as an "urgent" feature reuqest. I just noticed, while trying to import the Finnish GTFS feed, that fare_leg_rules.txt is not supported.

As this file is optional, I think that an import should be possible after deleting it ;)


Error message:

Error: invalid/unsupported file: fare_leg_rules
    at convertGtfsToSql (/app/index.js:117:10)
    at convertGtfsToSql.next (<anonymous>)
    at pumpToNode (node:internal/streams/pipeline:133:22)
    at pipelineImpl (node:internal/streams/pipeline:373:9)
    at pipeline (node:internal/streams/pipeline:183:10)
    at Object.<anonymous> (/app/cli.js:158:1)
    at Module._compile (node:internal/modules/cjs/loader:1257:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1115:32)
    at Module._load (node:internal/modules/cjs/loader:962:12)

And these are the files from the GTFS feed:

agency.txt
calendar.txt
calendar_dates.txt
fare_leg_rules.txt
feed_info.txt
routes.txt
shapes.txt
stops.txt
stop_times.txt
transfers.txt
trips.txt
derhuerst commented 1 year ago

Note that you should be able to at least ignore fare_leg_rules by using the --ignore-unsupported flag:

https://github.com/public-transport/gtfs-via-postgres/blob/7159d0f54a397f48e15ed1e3afda06ddc62389d0/cli.js#L81