Recent Releases of gtfstools
gtfstools - gtfstools v1.4.0
New features
download_validator()andvalidate_gtfs()now support using validator v5.0.0, v5.0.1 and v6.0.0.
Notes
- Removed the local copies of
{cpp11}functions, as the most recent releases fix the issues we were having.
- R
Published by dhersz over 1 year ago
gtfstools - gtfstools v1.3.0
New features
- New function
convert_sf_to_shapes(). - New generic function
as_dt_gtfs()with methods for a few different classes (tidygtfs,gtfsandlist). {gtfstools}functions now accepts GTFS objects created by other packages, such as{gtfsio}and{tidytransit}.filter_by_route_type()now accepts Google Transit's extended route types. Thanks @Ge-Rag.convert_shapes_to_sf(),get_trip_geometry(),get_trip_length(),get_trip_speed(),get_trip_segment_duration()andget_stop_times_patterns()now take an additional argumentsort_sequence, used to indicate whether shapes/timetables should be ordered byshape_pt_sequence/stop_sequencewhen applying the functions' procedures.download_validator()andvalidate_gtfs()now support using validator v4.1.0 and v4.2.0.- New parameters to
filter_by_stop_id():include_childrenandinclude_parents.
Bug fixes
- Fixed a bug in
convert_to_standard()in which the date fields fromfeed_infowould not be converted back to an integer in their standard format (YYYYMMDD). - Filtering functions now also filter the
transferstable based ontrip_idandroute_id. Previously they would filter it based only onstop_id. Thanks Daniel Langbein (@langbein-daniel). - Fixed a bug in
filter_by_route_id()in which feeds with only one agency that omittedagency_idinroutesandfare_attributeswould end up with an emptyagencytable. filter_by_sf()now correctly throws an error when an unsupported function is passed tospatial_operation.
Feature deprecation
- The
filter_by_stop_id()behavior of filtering by trips that contain the specified stops has been deprecated. For backwards compatibility reasons, this behavior is still the default as of the current version and is controlled by the parameterfull_trips. To actually filter by stop ids (the behavior that we now believe is the most appropriate), please usefull_trips = FALSE. This behavior will be the default from version 2.0.0 onward. To achieve the old behavior, manually subset the stoptimes table by `stopidand specify thetripids included in the output infilterbytripid()`. filter_by_sf()has been deprecated in favor offilter_by_spatial_extent(). For backwards compatibility reasons, usage offilter_by_sf()is still allowed as of the curent version, but the function will be removed from the package in version 2.0.0.
Notes
validate_gtfs()now defaults to run sequentially. Previously it would default to run parallelly using all available cores. Heavily inspired by Henrik Bengtsson post "Please Avoid detectCores() in your R packages" (https://www.jottr.org/2022/12/05/avoid-detectcores/).- Improved performance of
seconds_to_string()and, consequently, any other functions that use it. - Improved performance and improved readability of most filtering functions.
- R
Published by dhersz over 1 year ago
gtfstools - gtfstools v1.2.0
New features
- New
validate_gtfs()behavior. Now used to run MobilityData Canonical GTFS validator with a feed. The old behavior was marked as deprecated since v1.0.0. - New function
download_validator(). - New vignette demonstrating how to validate feeds.
Bug fixes
- Fixed a bug in
write_gtfs()that preventedas_dir = TRUEto be used. - Fixed a bug in
set_trip_speed()that resulted in invalid stoptimes tables when `max(stopsequence)` was higher than the number of stops of a given trip. Thanks Alena Stern (@alenastern). - Fixed a bug in
set_trip_speed()that resulted in the speed of wrong tripids being updated because of the order that these ids would appear in the trips and stoptimes tables. Thanks Alena Stern (@alenastern).
- R
Published by dhersz over 3 years ago
gtfstools - gtfstools v1.1.0
New features
- New function
convert_time_to_seconds(). - New function
filter_by_agency_id(). - New function
filter_by_service_id(). - New function
filter_by_time_of_day(). - New function
filter_by_weekday(). - New function
frequencies_to_stop_times(). - New function
get_children_stops(). - New function
get_stop_times_patterns(). - New function
get_trip_length(). - New parameter to
merge_gtfs():prefix. Thewarningsparameter was flagged as deprecated. - Functions
get_parent_station()andget_children_stopsnow acceptstop_id = NULLto analyze allstop_ids in thestopstable.
Bug fixes
- Fixed a bug in which
get_trip_segment_duration()would list wrong segment numbers, not necessarily starting from 1. Now segment numbers always range from 1 to N, where N is the total number of segments that compose each trip. - Fixed a bug in
filter_by_{route,service,shape,trip}_id()that resulted in theagencytable not getting filtered when the specified id wascharacter(0).
Notes
- Performance improvements to
get_trip_geometry(),get_trip_duration(),get_trip_segment_duration()andconvert_shapes_to_sf(). - Stopped ordering points by
shape_pt_sequence/stop_sequenceinget_trip_geometry()andconvert_shapes_to_sf(), since the GTFS reference says that thestop_timesandshapestables must be ordered by point/stop sequence anyway. - Removed
{lwgeom}from dependencies (Suggests), now that it's not required to runget_trip_speed()andset_trip_speed()anymore. - Removed the
warningsparameter fromread_gtfs()andwrite_gtfs()and theoptionalandextraparameters fromwrite_gtfs(), flagged as deprecated on gtfstools v1.0.0. - Updated filtering vignette to demonstrate new functions.
- R
Published by dhersz about 4 years ago
gtfstools - gtfstools v1.0.0
New features
- New function
convert_stops_to_sf(). - New function
convert_shapes_to_sf(). - New function
filter_by_route_type(). - New function
filter_by_route_id(). - New function
filter_by_sf(). - New function
filter_by_shape_id(). - New function
filter_by_stop_id(). - New function
filter_by_trip_id(). - New function
get_parent_station(). - New function
remove_duplicates(). - New parameters to
read_gtfs():fields,skipandencoding. Thewarningsparameter was flagged as deprecated. - New parameters to
write_gtfs():files,standard_onlyandas_dir. They substitute the previously existentoptionalandextra, which were flagged as deprecated. Thewarningsparameter was flagged as deprecated too. - New vignette exploring the filtering functions.
Bug fixes
get_trip_speed()andset_trip_speed()examples and tests now only run if{lwgeom}is installed.{lwgeom}is an{sf}"soft" dependency required by these functions, and is listed inSuggests. However, package checks would fail not so gracefully if it wasn't installed, which is now fixed.- Fixed a bug in which the
crspassed toget_trip_geometry()would be assigned to the result without actually reprojecting it. - Changed the behaviour of
get_trip_geometry()to not raise an error when the 'file' parameter is left untouched and the GTFS object doesn't contain either the shapes or the stop_times table. Closes #29. - Fixed a bug that would cause
merge_gtfs()to create objects that inherited only fromdt_gtfs(ignoringgtfsandlist). - Fixed a bug in which
get_trip_speed()returnedNAspeeds if the specifiedtrip_idwas listed in trips, but not in stop_times. - Adjusted
set_trip_speed()to stop raising amax()-related warning when none of the specifiedtrip_ids exists.
Notes
- Some utility functions previously provided by
{gtfs2gps}will now be exported by{gtfstools}. Huge thanks to the whole{gtfs2gps}crew (Rafael Pereira @rafapereirabr, Pedro Andrade @pedro-andrade-inpe and João Bazzo @Joaobazzo)! - The package now imports
{gtfsio}, and many functions now heavily rely on it, such asread_gtfs()andwrite_gtfs(). - Internal function
string_to_seconds()now runs much faster thanks to Mark Padgham (@mpadge). get_trip_geometry()now runs much faster due todata.table-related optimizations.
Potentially breaking changes
- Functions no longer validate GTFS objects on usage.
validate_gtfs()will be flagged as deprecated as well, since I plan to heavily change its usability and outputs in future versions. write_gtfs()parameters went through major changes - theoptionalandextraparams were flagged as deprecated and substituted by the more generalfilesandstandard_only.
- R
Published by dhersz over 4 years ago