Repository navigation
Major changes
- Faster routing 1. Compared with r5r 2.4.0 on the Porto Alegre and São Paulo sample data, car-only
travel_time_matrix(),arrival_travel_time_matrix(),accessibility()andpareto_frontier()are 2 to 4 times faster, bicycle-only routing 1.3 to 2.8 times, andexpanded_travel_time_matrix()1.5 to 2.6 times. Public transport routing in these functions takes about as long as before. - Faster routing 2.
detailed_itineraries()withshortest_path = TRUE(the default) and nofare_structurenow routes public transport with R5's RAPTOR algorithm, astravel_time_matrix()does, instead of McRAPTOR. It is 28 to 225 times faster on the Porto Alegre sample data, with the same output columns. See #603. Results can differ slightly:- departures are routed every minute of
time_windowinstead of at random seconds; - transfer walks are limited by
max_walk_time; - GTFS
pickup_type/drop_off_typerestrictions are respected; - ties between equally fast trips may resolve to a different route.
- Alternative routes (
shortest_path = FALSE) and fares still use McRAPTOR, and a pair that RAPTOR cannot route falls back to McRAPTOR. Closed #464.
- departures are routed every minute of
- New
seedargument intravel_time_matrix(),expanded_travel_time_matrix(),arrival_travel_time_matrix(),accessibility(),isochrone(),travel_time_surface()andpareto_frontier(). It makes the random departure offsets of frequency-based GTFS routes, and the departure times McRAPTOR samples withintime_window, reproducible across runs andn_threads. The defaultseed = NULLkeeps random draws. Inexpanded_travel_time_matrix()the trips of each minute are now numbered by total travel time, soarrival_travel_time_matrix()returns the fastest trip of the latest departure that arrives in time. Closes #593. See #597. - Uses R5 v7.6. Less than 1% of origin-destination pairs change on the Porto Alegre sample data, mostly with shorter public transport times. See #598:
- stops and points are linked to the nearest street even along long segments;
transfer_time(withbreakdown = TRUE) is now R5's transfer walking time, and waiting at the transfer stop is counted inwait_time;get_gtfs_errors()names some files without the.txtextension.- Networks built with earlier versions are rebuilt automatically.
- r5r requires R >= 4.1.0.
Bug fixes
- Java memory set with
options(java.parameters = "-Xmx...")beforelibrary(r5r)was ignored since r5r 2.2.0. It takes effect again. - With McRAPTOR (a
fare_structure,pareto_frontier(),detailed_itineraries()withshortest_path = FALSE), almost every origin was routed at the same departure times withintime_window. This was caused by an overflow in R5's random seed (conveyal/r5#1026). Each origin now gets its own reproducible sample, so results change slightly. Closes #601. accessibility()with thelogistic,exponentialandlineardecay functions ignored trips longer thanmax(cutoffs), which underestimated accessibility. Only thestepfunction now capsmax_trip_durationatmax(cutoffs).- #549 Public transport routing now requires an explicit
departure_datetime, since results depend on it. Without public transport, the current time is used.arrival_travel_time_matrix()requiresarrival_datetimefor all modes. Closed #486. pareto_frontier()now requiresfare_structureandfare_cutoffs. Withoutfare_cutoffsit failed, and withoutfare_structureit ignored fares.- Origins/destinations with duplicated
ids raise an error in one-to-many functions. Repeated ids are still allowed indetailed_itineraries()withall_to_all = FALSE. - A finite
max_farewithout afare_structureraises an error instead of being ignored. travel_time_matrix(),expanded_travel_time_matrix()andarrival_travel_time_matrix()swappedfrom_idandto_idwith walk-only routing and no elevation data, both in memory (fewer origins than destinations, a regression in 2.4.0, #501) and inoutput_dirfiles (more origins than destinations).arrival_travel_time_matrix():- for walk-, bike- or car-only trips with
max_walk_time,max_bike_timeormax_car_timebelowmax_trip_duration, it searched the wrong departure window; - it stopped searching at the first minute without a trip, missing pairs that could still arrive in time (#586);
- it compared arrivals using rounded durations (#586).
- for walk-, bike- or car-only trips with
expanded_travel_time_matrix()andarrival_travel_time_matrix()mixed up transit trips departing at 00:00:00 with street-only trips, and failed with walk-only routing and more than 5000 origins (#586).detailed_itineraries():- transfer walks took a duration different from the one used for routing, giving impossible timelines on networks with elevation data; they now take distance /
walk_speed; - transfer walks at the first stop had straight-line geometries;
- leg geometries repeated vertices, so they were invalid under s2 (#586);
- egress legs now keep the final partial street segment and the connection to the destination, with costs on the correct street endpoint (#607). Results can change, mainly for destinations on long street segments;
- zero-row
originsordestinationsreturn an empty result instead of crashing.
- transfer walks took a duration different from the one used for routing, giving impossible timelines on networks with elevation data; they now take distance /
isochrone():- polygons were shifted half a grid cell to the north-west;
- the polygon of the largest cutoff was cut short, so it depended on the other cutoffs; it is now complete and larger;
- line-based output (
polygon_output = FALSE) assigned segments to the wrong band with unsortedcutoffs; - line-based output now returns an
idcolumn,idis always character, and thest_centroidwarning is gone.
- #578 A call that failed after applying a scenario (
new_carspeeds,carspeed_scale,new_lts) left it active for the next call. Routing settings are now reset on exit, including on error. - Output files (
output_dir)- Text values containing commas are quoted (RFC 4180). This fixes every
detailed_itineraries()file, whosegeometry,osm_id_listandedge_id_listcolumns always contain commas. - Trips longer than
max_trip_durationare empty fields, asNAin memory, instead of2147483647(#586). detailed_itineraries()raises an error for repeated origin-destination pairs, which overwrote each other, and for ids that are not valid file names.
- Text values containing commas are quoted (RFC 4180). This fixes every
Minor changes
- r5r is dual-licensed under
GPL (>= 3) | MIT + file LICENSE. - The repository moved to https://github.com/ipea/r5r. #569 fixes the source links on the website. Closed #527.
accessibility()accepts fractional opportunities instead of truncating them to integers. Missing values count as 0 with a warning, and infinite values raise an error.- Progress (#596):
progressdefaults toTRUEin all routing functions;- the counter is printed by R, so it shows in every console, and reports every 1% of origins;
isochrone()no longer ignoresprogress.
- #596 Routing can be interrupted with Esc / Ctrl+C. The "Using cached R5 version" message now shows only with
verbose = TRUE. - #594
check_transit_availability()finds the operating dates, including calendar exceptions, when no dates are given. - Large matrices are passed from Java to R about 6 times faster.
- McRAPTOR itineraries in
detailed_itineraries()are found faster and with less memory. Withsuboptimal_minutes > 0, theoptionnumbers of two exactly tied itineraries can be swapped. - Logging when building networks with several GTFS feeds (#571) and in the direct trip router (#568, closed #557).
- Integer arguments (
max_walk_time,max_bike_time,max_car_time,max_trip_duration,time_window,percentiles,n_threads,max_rides,max_lts,draws_per_minute,cutoffs,suboptimal_minutes, andzoominisochrone()) reject non-integer values instead of truncating them. max_car_timenow caps car-only trips, not only the car legs of transit trips. Car-only trips can no longer end with a walk unbounded bymax_walk_time, so 3% of car travel times on the Porto Alegre sample are 1 to 8 minutes longer, now consistent withisochrone().- Input combinations that R5's McRAPTOR cannot handle now raise informative errors instead of hanging, running out of memory or failing with a cryptic Java error (#602):
- too many departure draws for
time_windowwith afare_structure(e.g. 8 draws per minute in 10 minutes, or the default 5 in 150 minutes or more); - exactly 200 draws (e.g.
time_window = 200inpareto_frontier()).
- too many departure draws for
percentilesandcutoffsare sorted, andcutoffsare validated (whole numbers from 1 to 120, no duplicates). They used to crash inside R5 or duplicate rows.- The
lineardecaydecay_valuemust be a whole number of minutes from 1 to 59. - Missing
lon/latnow trigger a warning listing the affected ids, instead of being dropped silently. - Java errors reach R with their original message instead of an empty
RuntimeException(#586). - #572
build_network()aborts with an informative message when a cachednetwork.datis rebuilt and fails on high-priority GTFS errors. Before, it returned an unusable network. sforigins/destinations that also hadlon/lat(orx/y) columns were routed at those columns instead of the point geometry.