This can happen when the input point is distant to any routable road segment. In this case, R5 will snap the point to the closest road segment that can be traversed with the selected transport mode, and it will consider that the person would walk in Euclidean distance from the input point to the snapped location. So R5 is accounting for this walking time “as the crow flies” in the routing.
r5r with custom modifications
to street network data?Yes, all routing and accessibility functions in
r5rhave the parametersnew_carspeeds,carspeed_scaleandnew_ltswhich allow one to use custom car speeds and LTS levels for cycling. These parameters provide convenient and efficient ways to build different scenarios of traffic congestion, road closure and interventions in cycling infrastructure. See this vignette. For other changes to the OSM network (e.g. including a new road link), you would need to edit the OpenStreetMap.pbffile directly before using it inr5r. To do this, you can edit the.pbffile with JOSM (https://wiki.openstreetmap.org/wiki/JOSM). OpenStreetMap tags can be changed but not removed.
travel_time_matrix()
and detailed_itineraries() different?The functions
travel_time_matrix()(andexpanded_travel_time_matrix()) anddetailed_itineraries()use different routing algorithms, as explained in the documentation of these functions. As such, we advise not to use or combine the output of these functions.
An error like “Geographic extent of street layer (5315196 km2) exceeds limit of 975000 km2” means your study area is too large. The limit is hardcoded in R5, so r5r cannot change it. The solution is to crop the
OpenStreetMap.pbfto your area of interest, e.g. with Osmosis. Download the latest Osmosis release, then call it from R:
# get the bounding box of your study area
study_area_polygon <- geobr::read_state(code_state = "ES")
area_bbox <- sf::st_bbox(study_area_polygon)
# input: the path to osmosis and the large pbf file in your local computer
osmosis_path <- "./osmosis_dir/bin/osmosis.bat"
large_pbf_path <- "./project_dir/large.pbf"
# path where you want to save the smaller .pbf file
smaller_pbf <-"./project_dir/smaller.pbf"
# prepare call to osmosis
osmosis_cmd <- sprintf("%s --read-pbf %s --bounding-box left=%s bottom=%s right=%s top=%s --write-pbf %s",
osmosis_path, large_pbf_path,
area_bbox["xmin"], area_bbox["ymin"], area_bbox["xmax"], area_bbox["ymax"],
smaller_pbf)
# call to osmosis
shell(osmosis_cmd, translate = TRUE)
Yes. By default, R5 considers the max speed limit of each road as set in OpenStreetMap data. You can change car speeds from within R with the
new_carspeedsandcarspeed_scaleparameters of the routing functions. See this vignette.
If your travel time / accessibility results are identical for public transport and walking, it is probably because R5 did not detect that the public transport network is available for your requested trips. This is likely to occur in case you set a
departure_datetimeoutside the calendar of public transport operations in your GTFS data. Check thecalendar.txtfile in your gtfs.zip feed. Alternatively, this could occur because there is no public transport trip option that would be faster than walking for the given origin-destination pair you queried.
r5r with custom modifications to
street network data?travel_time_matrix() and
detailed_itineraries() different?