Learn R Programming

gdalraster (version 1.11.1)

g_is_empty: Test if a geometry is empty

Description

g_is_empty() tests whether a geometry has no points.

Usage

g_is_empty(wkt)

Value

logical scalar. TRUE if the geometry has no points, otherwise FALSE.

Arguments

wkt

Character. OGC WKT string for a simple feature geometry.

Examples

Run this code
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()

Run the code above in your browser using DataLab