Description Usage Arguments Details Value See Also Examples
View source: R/osm_cleaning_functions.R
Select the main roads from OSM
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")
)
|
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. |
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.
Returns an data frame
Other OSM:
cluster_junction()
,
line_segment_sf()
,
nn_line()
,
nn_point()
,
osm_consolidate()
,
osm_get_junctions()
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.