weight_railway
Weight (or re-weight) an sf
-formatted OSM street network for routing
along railways.
weight_railway( sf_lines, type_col = "railway", id_col = "osm_id", keep_cols = c("maxspeed"), excluded = c("abandoned", "disused", "proposed", "razed") )
sf_lines |
A street network represented as |
type_col |
Specify column of the |
id_col |
Specify column of the codesf |
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_sc()
,
dodgr_streetnet()
,
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.