
Last chance! 50% off unlimited learning
Sale ends in
Function produces the Convex Hull of the given geometry, the smallest convex polygon that contains all subgeometries
gConvexHull(spgeom, byid=FALSE, id = NULL)
sp object as defined in package sp
Logical determining if the function should be applied across subgeometries (TRUE) or the entire object (FALSE)
Character vector defining id labels for the resulting geometries, if unspecified returned geometries will be labeled based on their parent geometries' labels.
Roger Bivand & Colin Rundel
Returns the convex hull as a SpatialPolygons object.
gBoundary
gCentroid
gEnvelope
gPointOnSurface
x = readWKT(paste("POLYGON((0 40,10 50,0 60,40 60,40 100,50 90,60 100,60",
"60,100 60,90 50,100 40,60 40,60 0,50 10,40 0,40 40,0 40))"))
ch = gConvexHull(x)
plot(x,col='blue',border='blue')
plot(ch,add=TRUE)
Run the code above in your browser using DataLab