topo-unary-gConvexHull: Convex Hull of Geometry

Description Usage Arguments Details Author(s) See Also Examples

Description

Function produces the Convex Hull of the given geometry, the smallest convex polygon that contains all subgeometries

Usage

1
gConvexHull(spgeom, byid=FALSE, id = NULL)

Arguments

spgeom

sp object as defined in package sp

byid

Logical determining if the function should be applied across subgeometries (TRUE) or the entire object (FALSE)

id

Character vector defining id labels for the resulting geometries, if unspecified returned geometries will be labeled based on their parent geometries' labels.

Details

Returns the convex hull as a SpatialPolygons object.

Author(s)

Roger Bivand & Colin Rundel

See Also

gBoundary gCentroid gEnvelope gPointOnSurface

Examples

1
2
3
4
5
6
7
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)

Example output

rgeos version: 0.3-23, (SVN revision 546)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

rgeos documentation built on Nov. 17, 2017, 4:28 a.m.