Major changes
|>.write_gtfs(), which ignored the overwrite argument and silently overwrote an existing file. With overwrite = FALSE it now raises an error of class gtfs2gps_file_exists_error if zipfile already exists.gtfs2gps(continue = TRUE) with compress = TRUE: it looked for .rda files while saving .rds, so shapes already saved were converted and written again instead of being skipped.gtfs_shapes_as_sf() now wraps gtfstools::convert_shapes_to_sf(). The crs argument transforms the shapes from WGS84 instead of relabelling their coordinates, and must be a valid CRS (NA is no longer accepted). The input is not modified. The result is a plain sf object (no longer also a data.table) with columns shape_id, geometry and length. shape_id must be character and shape_pt_sequence integer, as produced by read_gtfs().gtfs2gps() for shapes used by several trips:
route_id are now converted, each with its own route_type, and trip_number is the trip's index among all trips of the shape.Minor changes
gtfs2gps() is at least 3× faster on the poa feed and, on the São Paulo feed, at least 7× faster with about 80% lower peak memory (sequential runs).gtfs2gps() is faster: speeds and timestamps between stops are now interpolated on plain vectors instead of per-segment data.table sub-assignments. Output is unchanged.gtfs2gps(parallel = TRUE) no longer copies the whole feed to every worker: each worker receives only the trips, stop times, stops and geometry of the shapes it converts. This removes the "total size of the globals exported ... exceeds the maximum allowed size" failure on large feeds (#277) and lowers memory use. Shapes are also no longer looked up by scanning the full trips and stop_times tables, which makes the sequential path somewhat faster too. Output is unchanged.gtfs2gps() spends less time on each trip: stop times are split by trip once per stop pattern instead of being looked up for every trip, and each trip's GPS points are built on plain vectors instead of about 15 data.table operations. Output is unchanged.parallel = TRUE; it was silently lost before.trip_id listed under two different shapes (invalid GTFS) is now converted once, with the first shape in trips, instead of once per shape.write_gtfs() now validates its arguments, and its documentation gives the correct default of quiet (FALSE) and return value (the GTFS data, invisibly).write_gtfs(). Existing messages will be migrated to it gradually.gtfs2gps() (unreachable since v2.1-1, when gtfstools::frequencies_to_stop_times() took over) and the R-level time parser, now gtfstools::convert_time_to_seconds(). No output change for well-formed H:MM:SS times. In gtfs2gps() and adjust_arrival_departure(), malformed time strings (e.g. "05:21", which used to parse to an arbitrary value) are now treated as missing.adjust_arrival_departure() no longer modifies the input GTFS, works when arrival_time or departure_time is absent from stop_times, and returns a dt_gtfs object even for plain-list input.filter_valid_stop_times() now drops any time that is not of the form H:MM:SS (e.g. "05:21", which used to be kept) and no longer re-formats the strings it keeps.ncores. closes #271. When parallel = FALSE, this argument is ignored. When parallel = TRUE, then by default the function uses all available cores minus one.Major changes
gtfs2gps now uses parallel = TRUE by default.gtfs2gps now uses gtfstools::frequencies_to_stop_times() to convert. frequency-based GTFS feeds to stop times before processing the data.Minor changes
quiet to gtfs2gps()readr, pbapply, lwgeom and magrittr from package dependencies.filepath in gtfs2gps().Major changes
gtfstools package.Minor changes
adjust_speed() now does not change very low speed (1.000000e-12 [km/h]) because these values indicate a situation of a stopped vehicle. Closed 249.gtfs2gps() now creates two points for a stop when arrival and departure exist. Speed and travel time are now calculated considering both departure_ and arrival_time columns.gtfs2gps() function.adjust_arrival_departure() to allow users set a minimum time for dis/embarking times at each stop.adjust_speed() to fix outlier speeds and replace missing speed values with a speed set by the user or the average speed of the system. The timestamp values are updated accordingly.Major changes
Minor changes
Major changes
calendar_dates.txt info. Closes #103, #124 and #141compress parameter in gtfs2gps function so that users can save the function outputs in compressed .RDS format.remove_by_route_id() to remove GTFS data by route ids. Closes #180stop_sequence in the wrong orderMinor changes
Major changes
Minor changes
gps_as_sflinestring() due to new GDALsf_multipoint by sf_point in gps_as_sf() to keep all the data