Cluster junction points into polygons
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. |
Returns an SF data frame of POLYGONS
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.
Other OSM:
line_segment_sf(),
nn_line(),
nn_point(),
osm_consolidate(),
osm_get_junctions(),
osm_main_roads()
x = osm_main_roads(tc_data_osm) #> Loading required namespace: sf junctions = osm_get_junctions(x) #> Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1 junction_polygons_15 = cluster_junction(junctions) #> Clustering 50 junctions #> Creating 35 geometries junction_polygons_30 = cluster_junction(junctions, dist = 30) #> Clustering 50 junctions #> Creating 22 geometries plot(x$geometry, col = "grey") plot(junction_polygons_30, add = TRUE) #> Warning: ignoring all but the first attribute plot(junction_polygons_15, add = TRUE) #> Warning: ignoring all but the first attribute![]()