Learn R Programming

rgeos (version 0.2-4)

gIsEmpty: Is Geometry Empty?

Description

Tests if the given geometry is empty

Usage

gIsEmpty(spgeom, byid = FALSE)

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)

Value

  • Returns TRUE if the given geometry is empty, FALSE otherwise.

See Also

gIsRing gIsSimple gIsValid

Examples

Run this code
gIsEmpty(readWKT("POINT EMPTY"))
gIsEmpty(readWKT("POINT(1 1)"))
gIsEmpty(readWKT("LINESTRING EMPTY"))
gIsEmpty(readWKT("LINESTRING(0 0,1 1)"))
gIsEmpty(readWKT("POLYGON EMPTY"))
gIsEmpty(readWKT("POLYGON((0 0,1 0,1 1,0 1,0 0))"))

Run the code above in your browser using DataLab