geos_is_valid: Geometry validity

View source: R/geos-unary-atomic.R

geos_is_validR Documentation

Geometry validity

Description

  • geos_is_valid() returns a logical vector denoting if each feature is a valid geometry.

  • geos_is_valid_detail() returns a data frame with columns is_valid (logical), reason (character), and location (geos_geometry).

Usage

geos_is_valid(geom)

geos_is_valid_detail(geom, allow_self_touching_ring_forming_hole = FALSE)

Arguments

geom

A GEOS geometry vector

allow_self_touching_ring_forming_hole

It's all in the name

Examples

geos_is_valid(
  c(
    "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))",
    "POLYGON ((0 0, 1 1, 1 0, 0 1, 0 0))"
  )
)

geos_is_valid_detail(
  c(
    "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))",
    "POLYGON ((0 0, 1 1, 1 0, 0 1, 0 0))"
  )
)


geos documentation built on June 7, 2023, 6:04 p.m.