philvessey / NextDepartures

NextDepartures is a .NET Library that queries GTFS (General Transit Feed Specification) data sets stored locally or in an Azure SQL Database. The library will work with any well formed GTFS data set.
MIT License
1 stars 1 forks source link

Storage: GTFS Feed from GTFS library #14

Closed hypervtechnics closed 4 years ago

hypervtechnics commented 4 years ago

Implemently partly at least for the service relevant sections.

philvessey commented 4 years ago

Thanks for starting on this - i'm going to implement the missing methods over the next day or so as I have enough from your code to get started.

philvessey commented 4 years ago

I have implemented all the methods and have started some initial testing which I will complete tomorrow.

philvessey commented 4 years ago

I have fixed a couple of issues and completed testing and everything is now working as expected and data returned is correct. This issue is now complete.

hypervtechnics commented 4 years ago

Cool! 😄

@philvessey Is it possible to ignore the validity dates and make a gtfs feed "live forever". I have a feed from December which entries somehow are limited until 26.12.2019. Is it possible to turn off those checks or are they enforced by the data structure/gtfs spec? Not directly related to this issue. If yes I would make a new one for this.

philvessey commented 4 years ago

@hypervtechnics The dates are enforced in the feed data from Calendar and CalendarDates - turning off the checks would mean you potentially show services that are not running. The feed I use for testing for example has UK rail services from 20191215 to 20200510 to it guarantees the service is at least running until 10th May 2020 - taking away the checks might mean the service actually doesn't run anymore after May but still shows results which isn't the way to go.

Which feed do you have - normally when dates expire / pass the feed publishers put out new ones with new dates assuming the services are still running.

philvessey commented 4 years ago

@hypervtechnics with the linq you wrote for GetDeparturesFromFeedByCondition that has the join statements - what would happen if _feed.Calendars is empty as some feeds don't include calendar.txt - will that join statement always return an empty list if calendar.txt isn't present and therefore _feed.Calendars.Length = 0 ?

hypervtechnics commented 4 years ago

turning off the checks would mean you potentially show services that are not running.

So if the calendars file does not contain any start_date and end_date data I can also work with data effective last december - that would be exactly what I want. Also imagine it as this use case: I want to know at what time bus 1a departs if the schedule from december 2019 would still be valid.

Which feed do you have - normally when dates expire / pass the feed publishers put out new ones with new dates assuming the services are still running.

My publisher takes 3-4 days after the new month to publish the information which is quite annoying as during this time there would be no showing of departures possible.

For the LINQ I will test it without the calendar file being present.

philvessey commented 4 years ago

So if the calendars file does not contain any start_date and end_date data I can also work with data effective last december - that would be exactly what I want. Also imagine it as this use case: I want to know at what time bus 1a departs if the schedule from december 2019 would still be valid.

I see what you are saying - I will have a think to see if there is anyway of maybe considering this check once the other checks have run and returned no results.

My publisher takes 3-4 days after the new month to publish the information which is quite annoying as during this time there would be no showing of departures possible.

Yes that would get pretty annoying if they are not on the ball putting out updates

For the LINQ I will test it without the calendar file being present.

I tested yesterday on several feeds and it was returning zero results constantly when _feed.Calendars.Length = 0 although maybe Sunday wasn't the best day to test but I looked at a few different feeds.