View source: R/st_no_overlap.R
st_no_overlap | R Documentation |
This function takes a set of polygons and returns a new set of polygons where the buffer zones of the original polygons do not overlap with each other. This is achieved by calculating the centroids of the polygons, creating a Voronoi tesselation around the centroids, and intersecting the Voronoi zones with the buffer zones of the original polygons. The resulting polygons do not overlap with each other, ensuring that they can be used for further analysis or visualization. Inspired by this post
st_no_overlap(polygons)
polygons |
A set of polygons with attributes. |
This function uses the sf
package to calculate the centroids of
the polygons using the st_centroid
function, and to create a Voronoi
tesselation around the centroids using the st_voronoi
function. The Voronoi
zones are then intersected with the buffer zones of the original polygons
using the st_intersection
function. The resulting polygons are returned
with their original attributes.
A set of polygons with attributes where the buffer zones of the original polygons do not overlap with each other.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.