cluster_junction: Cluster junction points into polygons

Description Usage Arguments Details Value See Also Examples

View source: R/osm_cleaning_functions.R

Description

Cluster junction points into polygons

Usage

1
cluster_junction(x, dist = 15, nQuadSegs = 3)

Arguments

x

a SF data frame of joints

dist

buffer distance past to sf::st_buffer

nQuadSegs

how many segments per quatrant? 5 is the default.

Details

This function clusters points together and defines junction polygons, the size of the polygons is dictated by dist. For single junction points a circle around the junction point is returned. For clustered junctions a polygon enclosing the whole junction area is returned. A column called junction_ids provides a looup list between the junction clusters and the junction points.

Value

Returns an SF data frame of POLYGONS

See Also

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

Examples

1
2
3
4
5
6
7
x = osm_main_roads(tc_data_osm)
junctions = osm_get_junctions(x)
junction_polygons_15 = cluster_junction(junctions)
junction_polygons_30 = cluster_junction(junctions, dist = 30)
plot(x$geometry, col = "grey")
plot(junction_polygons_30, add = TRUE)
plot(junction_polygons_15, add = TRUE)

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