Learn R Programming

r5r (version 0.7.0)

setup_r5: Create transport network used for routing in R5

Description

Combine data inputs in a directory to build a multimodal transport network used for routing in R5. The directory must contain at least one street network file (in .pbf format). One or more public transport data sets (in GTFS.zip format) are optional. If there is more than one GTFS file in the directory, both files will be merged. If there is already a 'network.dat' file in the directory the function will simply read it and load it to memory.

Usage

setup_r5(
  data_path,
  version = "6.4.0",
  verbose = TRUE,
  temp_dir = FALSE,
  use_elevation = FALSE,
  overwrite = FALSE
)

Arguments

data_path

character string, the directory where data inputs are stored and where the built network.dat will be saved.

version

character string, the version of R5 to be used. Defaults to latest version '6.4.0'.

verbose

logical, TRUE to show detailed output messages (Default) or FALSE to show only eventual ERROR and WARNING messages.

temp_dir

logical, whether the R5 Jar file should be saved in temporary directory. Defaults to FALSE

use_elevation

logical. If TRUE, load any tif files containing elevation found in the data_path folder and calculate impedances for walking and cycling based on street slopes.

overwrite

logical, whether to overwrite an existing network.dat or to use a cached file. Defaults to FALSE (i.e. use a cached network).

Value

An rJava object to connect with R5 routing engine

See Also

Other setup: download_r5()

Examples

Run this code
# NOT RUN {
if (interactive()) {

library(r5r)

# directory with street network and gtfs files
path <- system.file("extdata/poa", package = "r5r")

r5r_core <- setup_r5(data_path = path, temp_dir = TRUE)

}
# }

Run the code above in your browser using DataLab