Extract OpenStreetMap network in sf format from a network.dat file

street_network_to_sf(r5r_core)

Arguments

r5r_core

An object to connect with the R5 routing engine, created with setup_r5().

Value

A list with two components of a street network in sf format: vertices (POINT) and edges (LINESTRING).

See also

Other network functions: find_snap(), transit_network_to_sf()

Examples

library(r5r)

# build transport network
path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(path)
#> Using cached R5 version from /home/runner/.cache/R/r5r/r5_jar_v7.1.0/r5-v7.1-all.jar
#> 
#> Using cached network.dat from /home/runner/work/_temp/Library/r5r/extdata/poa/network.dat

# extract street network from r5r_core
street_net <- street_network_to_sf(r5r_core)

stop_r5(r5r_core)
#> r5r_core has been successfully stopped.