Learn R Programming

r5r (version 0.7.1)

transit_network_to_sf: Extract transit network in sf format

Description

Extract transit network in sf format from a network.dat file built with the setup_r5 function.

Usage

transit_network_to_sf(r5r_core)

Value

A list with two components of a transit network in sf format: route shapes (LINESTRING) and transit stops (POINT). The same route_id/short_name might appear with different geometries. This occurs when a route has two different shape_ids. Some transit stops might be returned with geometry POINT EMPTY (i.e. missing NA

spatial coordinates). This may occur when a transit stop is not snapped to the road network, possibly because the gtfs.zip input data covers an area larger than the osm.pbf input data.

Arguments

r5r_core

a rJava object, the output from 'r5r::setup_r5()'

See Also

Other support functions: assert_breakdown_stat(), assert_decay_function(), assert_points_input(), check_connection(), fileurl_from_metadata(), find_snap(), posix_to_string(), select_mode(), set_max_lts(), set_max_rides(), set_max_street_time(), set_n_threads(), set_progress(), set_speed(), set_suboptimal_minutes(), set_verbose(), stop_r5(), street_network_to_sf()

Examples

Run this code
if (interactive()) {

library(r5r)

# build transport network
path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path = path, temp_dir = TRUE)

# extract transit network from r5r_core
transit_net <- transit_network_to_sf(r5r_core)

stop_r5(r5r_core)
}

Run the code above in your browser using DataLab