ipeaGIT / gtfs2gps

Convert GTFS data into a data.table with GPS-like records in R
https://ipeagit.github.io/gtfs2gps/
Other
71 stars 10 forks source link

incompatibility with gtfstools #245

Closed rafapereirabr closed 2 years ago

rafapereirabr commented 2 years ago

It seems the output of gtfs2gps::read_gtfs() migh not compatible with gtfstools filter functions due to classes.

gtfs2gps::read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps")) %>%
   gtfstools::filter_by_weekday(weekday ='monday')

Unzipped the following files to C:\Users\user\AppData\Local\Temp\RtmpYLsACZ/gtfsio:

  • agency.txt
  • calendar.txt
  • routes.txt
  • shapes.txt
  • stop_times.txt
  • stops.txt
  • trips.txt Reading agency.txt Reading calendar.txt Reading routes.txt Reading shapes.txt Reading stop_times.txt Reading stops.txt Reading trips.txt Error in gtfstools::filter_by_weekday(., weekday = "monday") : Assertion on 'gtfs' failed: Must inherit from class 'dt_gtfs', but has classes 'gtfs','list'.
rafapereirabr commented 2 years ago

I guess the best alternative here is to add the class dt_gtfs to the output of gtfs2gps::read_gtfs()