weight_railway | R Documentation |
Weight (or re-weight) an sf
-formatted OSM street network for routing
along railways.
weight_railway(
x,
type_col = "railway",
id_col = "osm_id",
keep_cols = c("maxspeed"),
excluded = c("abandoned", "disused", "proposed", "razed")
)
x |
A street network represented either as |
type_col |
Specify column of the |
id_col |
Specify column of the sf |
keep_cols |
Vectors of columns from |
excluded |
Types of railways to exclude from routing. |
A data.frame
of edges representing the rail network, along
with a column of graph component numbers.
Default railway weighting is by distance. Other weighting schemes, such
as by maximum speed, can be implemented simply by modifying the
d_weighted
column returned by this function accordingly.
Other extraction:
dodgr_streetnet()
,
dodgr_streetnet_sc()
,
weight_streetnet()
## Not run:
# sample railway extraction with the 'osmdata' package
library (osmdata)
dat <- opq ("shinjuku") %>%
add_osm_feature (key = "railway") %>%
osmdata_sf (quiet = FALSE)
graph <- weight_railway (dat$osm_lines)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.