node-gtfs icon indicating copy to clipboard operation
node-gtfs copied to clipboard

More specific query functions

Open laem opened this issue 1 year ago • 5 comments

Hi, I'm happy to showcase this kind of feature made possible by this library :)

Recording 2024-10-11 at 21 40 53

I also wonder if this kind of feature, that I call immediateStopTimes in my code, could have a place in node-GTFS ?

Or maybe in a list of projects using node-GTFS ?

laem avatar Oct 11 '24 20:10 laem

Awesome - thanks for sharing.

Can you link to where this is live so I can check it out?

I like your idea to make it easier to get stop times for a specific date and time - I'll think on the best way to implement this.

brendannee avatar Oct 12 '24 21:10 brendannee

Check out this link https://cartes-git-plans2-menoz.vercel.app/?transports=oui#17.4/48.097417/-1.69814

Then navigate on the map near bus and metro stops. It's alpha, so might break in the following days, but will be online on cartes.app soon.

laem avatar Oct 13 '24 09:10 laem

Great suggestion to add a way to get upcoming stop times a little easier.

I published and updated version which has a few changes which should be useful: https://github.com/BlinkTagInc/node-gtfs/releases/tag/4.15.3

  • getServiceIdsByDate - this will let you get an array of service_ids for a specific date, taking into account calendar_dates exceptions

  • getStoptimes support for date, start_time, end_time. This method now accepts additional parameters Read more https://github.com/BlinkTagInc/node-gtfs?tab=readme-ov-file#getstoptimesquery-fields-sortby-options So you can do something like:

const stoptimes = getStoptimes({ stop_id: '70011', date: 20160704, start_time: '11:30:00', end_time: '11:45:00' });

Try these out and let me know what you think - are there other things that help make it easier to use the library for common use cases?

brendannee avatar Oct 17 '24 08:10 brendannee

Thanks for this enhancement! It's not entirely clear from the docs, is this only static data or will this take into account timing adjustments from realtime gtfs data if configured?

steemcb-phorest avatar Nov 26 '24 21:11 steemcb-phorest

Only static data at the moment - but that is a good suggestion.

brendannee avatar Nov 27 '24 08:11 brendannee