Description Usage Arguments Details Value See Also Examples
View source: R/osm_cleaning_functions.R
Cluster junction points into polygons
1 | cluster_junction(x, dist = 15, nQuadSegs = 3)
|
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. |
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.
Returns an SF data frame of POLYGONS
Other OSM:
line_segment_sf()
,
nn_line()
,
nn_point()
,
osm_consolidate()
,
osm_get_junctions()
,
osm_main_roads()
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.