osm_main_roads: Select the main roads from OSM

Description Usage Arguments Details Value See Also Examples

View source: R/osm_cleaning_functions.R

Description

Select the main roads from OSM

Usage

1
2
3
4
5
6
osm_main_roads(
  x,
  highway_values = c("primary", "primary_link", "secondary", "secondary_link",
    "tertiary", "tertiary_link", "trunk", "trunk_link", "motorway", "motorway_link",
    "unclassified", "residential", "road", "mini_roundabout")
)

Arguments

x

A data frame of OSM lines

highway_values

Which highway values to use to define 'main' roads? Default includes primary, secondar, trunk, motorway, residential and 'mini_roundabout' road values.

Details

The OpenSteetMap contains a lot of detail, this function subsets the data to just the main roads used by cars by filtering on the highway tag.

Value

Returns an data frame

See Also

Other OSM: cluster_junction(), line_segment_sf(), nn_line(), nn_point(), osm_consolidate(), osm_get_junctions()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
region_name = "Isle of Wight"
# osm = osmextract::oe_get(region_name) # test for IoW
# region_name = "Greater London" # test for London
osm = tc_data_osm
osm_main = osm_main_roads(osm)
nrow(osm)
nrow(osm_main)
nrow(osm_main) / nrow(osm) # keeps ~10-25% of lines
plot(osm$geometry, col = "grey")
plot(osm_main$geometry, add = TRUE)

saferactive/traffiCalmr documentation built on Nov. 18, 2021, 5:06 a.m.