Skip to contents

g_is_empty() tests whether a geometry has no points.

Usage

g_is_empty(geom, quiet = FALSE)

Arguments

geom

Either a raw vector of WKB or list of raw vectors, or a character vector containing one or more WKT strings.

quiet

Logical, TRUE to suppress warnings. Defaults to FALSE.

Value

logical vector of the same length as the number of input geometries in geom, containing TRUE for the corresponding geometies that are empty or FALSE for non-empty geometries.

Examples

g1 <- "POLYGON ((0 0, 10 10, 10 0, 0 0))"
g2 <- "POLYGON ((5 1, 9 5, 9 1, 5 1))"
g_difference(g2, g1) |> g_is_empty()
#> [1] TRUE