derhuerst / berlin-gtfs-rt-server

Expose Berlin & Brandenburg transit data as a GTFS-RT feed.
https://v0.berlin-gtfs-rt.transport.rest/
Other
12 stars 1 forks source link

Question: Do I realy need to provide the GTFS Schedule feed at 2 places? #11

Closed dancesWithCycles closed 8 months ago

dancesWithCycles commented 8 months ago

Hi! I was wondering if I really need to provide the GTFS Schedule feed at 2 places.

In the database:

https://github.com/derhuerst/berlin-gtfs-rt-server/blob/7e9e095878ae3ea13c976fee1fa3e39643ed28b2/build.sh#L9

Via URL:

https://github.com/derhuerst/berlin-gtfs-rt-server/blob/7e9e095878ae3ea13c976fee1fa3e39643ed28b2/start.sh#L29

Is there a workaround for GTFS Schedule feeds that ar not provided via URL?

Cheers!

derhuerst commented 8 months ago

In the database:

https://github.com/derhuerst/berlin-gtfs-rt-server/blob/7e9e095878ae3ea13c976fee1fa3e39643ed28b2/build.sh#L9

berlin-gtfs-rt-server is just a thin wrapper around hafas-gtfs-rt-feed, which actually needs your GTFS Schedule feed to import it into the DB and use it to match HAFAS data.

Therefore, you could modify this repo's build.sh to obtain the GTFS feed however you want it (directly using files from another location, obtaining them from an object store, etc.). However, as explained in https://github.com/derhuerst/berlin-gtfs-rt-server/issues/12#issuecomment-1946988147, using hafas-gtfs-rt-feed directly might be more straightforward.

Via URL:

https://github.com/derhuerst/berlin-gtfs-rt-server/blob/7e9e095878ae3ea13c976fee1fa3e39643ed28b2/start.sh#L29

This is a feature of hafas-gtfs-rt-feed where it signals to consumers which (version of the) GTFS Schedule feed the GTFS Realtime feed "fits to". It is inspired by https://github.com/TransitTracker/backend/issues/12, which I want to bring to gtfs-rt-inspector.

All the flag does is cause a redirect from /gtfs-static to the specified GTFS feed's URL.

https://github.com/derhuerst/hafas-gtfs-rt-feed/blob/36a54167a7d8d7296a0beef76122cc6457ef79fb/serve.js#L70

https://github.com/derhuerst/hafas-gtfs-rt-feed/blob/36a54167a7d8d7296a0beef76122cc6457ef79fb/lib/serve.js#L217-L220

derhuerst commented 8 months ago

Closing, please re-open if this didn't answer your question.