valid

0th

Percentile

Make an invalid geometry valid

Make an invalid geometry valid

Usage
st_make_valid(x)
Arguments
x

object of class sfg, sfg or sf

Details

st_make_valid uses the lwgeom_makevalid method also used by the PostGIS command ST_makevalid if the GEOS version linked to is smaller than 3.8.0, and otherwise the version shipped in GEOS.

Value

Object of the same class as x

Aliases
  • valid
  • st_make_valid
Examples
# NOT RUN {
library(sf)
x = st_sfc(st_polygon(list(rbind(c(0,0),c(0.5,0),c(0.5,0.5),c(0.5,0),c(1,0),c(1,1),c(0,1),c(0,0)))))
suppressWarnings(st_is_valid(x))
y = st_make_valid(x)
st_is_valid(y)
y %>% st_cast()
# }
Documentation reproduced from package sf, version 0.9-1, License: GPL-2 | MIT + file LICENSE

Community examples

Looks like there are no examples yet.