Learn R Programming

gdalraster (version 1.11.1)

g_is_valid: Test if a geometry is valid

Description

g_is_valid() tests whether a geometry is valid.

Usage

g_is_valid(wkt)

Value

logical scalar. TRUE if the geometry is valid, 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))"
g_is_valid(g1)

g2 <- "POLYGON ((0 0, 10 10, 10 0, 0 1))"
g_is_valid(g2)

Run the code above in your browser using DataLab