Closed rafapereirabr closed 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()
@dhersz, gtfs2gps::merge_gtfs_feeds()
just adds a prefix to the unique ids of each gtfs and then merge their respective files.
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.
@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.
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.
Closing this since we have more specific issues covering each function.
Hi all @dhersz @pedro-andrade-inpe @Joaobazzo , I think we can start having a conversation about integrating the
gtfs2gps
andgtfstools
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 thegtfstools
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
togtfstools
. 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 ofgtfs2gps
co-authorsgtfstools
.Filter
filter_day_period()
filter_by_day()
filter_week_days()
filter_by_agency_id()
filter_single_trip()
filter_by_route_id()
filter_by_route_type()
filter_by_shape_id()
filter_valid_stop_times()
Spatial
gtfs_shapes_as_sf()
gtfs_stops_as_sf()
others
merge_gtfs_feeds()
remove_invalid()
to Remove invalid objects from GTFS data