convHull | R Documentation |
Get the convex hull, the minimal bounding rotated rectangle, or minimal bounding circle of a SpatVector
## S4 method for signature 'SpatVector'
convHull(x, by="")
## S4 method for signature 'SpatVector'
minRect(x, by="")
## S4 method for signature 'SpatVector'
minCircle(x, by="")
x |
SpatVector |
by |
character (variable name), to get a new geometry for groups of input geometries |
SpatVector
p <- vect(system.file("ex/lux.shp", package="terra"))
h <- convHull(p)
hh <- convHull(p, "NAME_1")
rr <- minRect(p, "NAME_1")
plot(rr, lwd=5, border="gray")
plot(hh, "NAME_1", col=rainbow(10, alpha=.5), lwd=3, add=TRUE, plg=list(x="topright"))
lines(aggregate(p, "NAME_1"), col="blue", lty=2, lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.