Title: | Automatic Repair of Spatial Polygons |
---|---|
Description: | Automatically repair broken spatial polygons using constrained triangulation. The computational methodology is derived from Ledoux et al. (2014) <doi:10.1016/j.cageo.2014.01.009>. |
Authors: | Ahmadou Dicko [aut], Jeffrey O Hanson [aut, cre] , Edzer Pebesma [ctb] , Ken Arroyo Ohori [ctb, cph] (https://github.com/tudelft3d/prepair), Hugo Ledoux [ctb, cph] (https://github.com/tudelft3d/prepair), Martijn Meijers [ctb, cph] (https://github.com/tudelft3d/prepair) |
Maintainer: | Jeffrey O Hanson <[email protected]> |
License: | GPL-3 |
Version: | 0.3.0 |
Built: | 2024-12-13 01:38:24 UTC |
Source: | https://github.com/prioritizr/prepr |
This package contains functions to repair single polygons according to the international standards ISO 19107 using a constrained triangulation approach. It is based on the prepair C++ tool.
Maintainer: Jeffrey O Hanson [email protected] (ORCID)
Authors:
Ahmadou Dicko [email protected]
Other contributors:
Edzer Pebesma [email protected] (ORCID) [contributor]
Ken Arroyo Ohori [email protected] (https://github.com/tudelft3d/prepair) [contributor, copyright holder]
Hugo Ledoux [email protected] (https://github.com/tudelft3d/prepair) [contributor, copyright holder]
Martijn Meijers [email protected] (https://github.com/tudelft3d/prepair) [contributor, copyright holder]
Useful links:
Repair polygon geometries according to the international standards ISO 19107 using a constrained triangulation approach (van Oosterom et al. 2005; Ledoux et al. 2014)
st_prepair(x)
st_prepair(x)
x |
|
The function supports two algorithms:
oddeven: an extension of the odd-even algorithm to handle polygons containing inner rings and degeneracies;
setdiff: one where we follow a point set difference rule for the rings (outer - inner).
A sf::st_sf()
, sf::st_sfc()
or sfg
object (same as the argument to x
).
Ledoux H, Arroyo Ohori K, and Meijers M (2014) A triangulation-based approach to automatically repair GIS polygons. Computers & Geosciences 66:121–131.
van Oosterom P, Quak W, and Tijssen T (2005) About Invalid, Valid and Clean Polygons In: Developments in Spatial Data Handling. Springer, Berlin, Heidelberg
See sf::st_make_valid()
for another approach to repair polygon
geometries.
## Not run: # create an object containing a broken polygon geometry x <- sf::st_as_sfc("POLYGON((0 0, 0 10, 10 0, 10 10, 0 0))") # check if this polygon is indeed broken sf::st_is_valid(x) # repair the polygon y <- st_prepair(x) # check that the repaired polygon has been fixed print(st_is_valid(y)) ## End(Not run)
## Not run: # create an object containing a broken polygon geometry x <- sf::st_as_sfc("POLYGON((0 0, 0 10, 10 0, 10 10, 0 0))") # check if this polygon is indeed broken sf::st_is_valid(x) # repair the polygon y <- st_prepair(x) # check that the repaired polygon has been fixed print(st_is_valid(y)) ## End(Not run)