centroids {terra} | R Documentation |
Centroids
Description
Get the centroids of polygons or lines, or centroid-like points that are guaranteed to be inside the polygons or on the lines.
Usage
## S4 method for signature 'SpatVector'
centroids(x, inside=FALSE)
Arguments
x |
SpatVector |
inside |
logical. If |
Value
SpatVector of points
Examples
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
x <- centroids(v)
y <- centroids(v, TRUE)
[Package terra version 1.7-78 Index]