Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pred-unary-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)

Details

Because no sp Spatial object may be empty, the function exists but cannot work, as readWKT is not permitted to create an empty object.

Value

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

Author(s)

Roger Bivand & Colin Rundel

See Also

Examples

try(gIsEmpty(readWKT("POINT EMPTY")))
gIsEmpty(readWKT("POINT(1 1)"))
try(gIsEmpty(readWKT("LINESTRING EMPTY")))
gIsEmpty(readWKT("LINESTRING(0 0,1 1)"))
try(gIsEmpty(readWKT("POLYGON EMPTY")))
gIsEmpty(readWKT("POLYGON((0 0,1 0,1 1,0 1,0 0))"))

rgeos

Interface to Geometry Engine - Open Source ('GEOS')

v0.5-5
GPL (>= 2)
Authors
Roger Bivand [cre, aut] (<https://orcid.org/0000-0003-2392-6140>), Colin Rundel [aut], Edzer Pebesma [ctb], Rainer Stuetz [ctb], Karl Ove Hufthammer [ctb], Patrick Giraudoux [ctb], Martin Davis [cph, ctb], Sandro Santilli [cph, ctb]
Initial release
2020-09-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.