ipeaGIT / gtfstools

General Transit Feed Specification (GTFS) Editing and Analysing Tools
https://ipeagit.github.io/gtfstools/
Other
40 stars 8 forks source link

Relationship between gtfs2gps and gtfstools #6

Closed rafapereirabr closed 3 years ago

rafapereirabr commented 3 years ago

Hi all @dhersz @pedro-andrade-inpe @Joaobazzo , I think we can start having a conversation about integrating the gtfs2gps and gtfstools packages. Here is a quick summary of my take on this.

The gtfs2gps has a very focused purpouse, which is to conver gtfs to a GPS-like data format. However, we have already developed many functions that help the user conveniently and quickly edit a GTFS feed. Meanwhile, the core aim of the gtfstools package is to provide tools for the manipulation of gtfs data.

I think it would be good if we could migrate some of these functions from gtfs2gps to gtfstools. See below the functions that I initially thought could be migrated. The details of this migration would have to be dicussed case-by-case. Naturally, this would imply making the authors of gtfs2gps co-authors gtfstools.

Filter

Spatial

others

dhersz commented 3 years ago

I agree that these functions see a more natural fit on gtfstools, and I'd be more than happy to work with you all!

These filtering functions are on my to do list since day 1, and one of the main reasons I started working on gtfstools was to able to apply them to a full representation of a GTFS in R. I just haven't had the time yet to incorporate them, but I'll start working on it soon after finishing an introduction vignette.

P.S. I have recently implemented a merge_gtfs() function. I don't know how that compares to gtfs2gps::merge_gtfs_feeds()

pedro-andrade-inpe commented 3 years ago

@dhersz, gtfs2gps::merge_gtfs_feeds() just adds a prefix to the unique ids of each gtfs and then merge their respective files.

dhersz commented 3 years ago

Thanks to let me know @pedro-andrade-inpe! Currently merge_gtfs() doesn't disambiguate ids, I'll add an add_prefix argument to the function very soon to allow for that.

rafapereirabr commented 3 years ago

@dhersz , it would also make much easier for us to migrate the gtfs2gps functions with their respective tests to gtfstools if some of our sample GTFS feeds were included in the inst/extdata directory of gtfstools. These are the feeds we currently have in gtfs2gps.

If this is Ok with you, we can start gradually sending some push requests.

dhersz commented 3 years ago

I have added the functions to test the existence of GTFS files/fields in https://github.com/ipeaGIT/gtfstools/commit/1be4e11131dfcb8c85d4a6cc9c607880bbb46247. They are called test_file_exists() and test_field_exists().

If the file/field exists, the function returns TRUE. Otherwise, FALSE. They should be working alright, but keep me noted if you find an issue with time.

dhersz commented 3 years ago

Closing this since we have more specific issues covering each function.