Package 'prepr'

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

Help Index


A package for automatically repairing broken polygons

Description

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.

Author(s)

Maintainer: Jeffrey O Hanson [email protected] (ORCID)

Authors:

Other contributors:

See Also

Useful links:


Automatic repair of polygon geometries

Description

Repair polygon geometries according to the international standards ISO 19107 using a constrained triangulation approach (van Oosterom et al. 2005; Ledoux et al. 2014)

Usage

st_prepair(x)

Arguments

x

sf::st_sf(), sf::st_sfc() or sfg object (containing POLYGON or MULTIPOLYGON geometries).

Details

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).

Value

A sf::st_sf(), sf::st_sfc() or sfg object (same as the argument to x).

References

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 Also

See sf::st_make_valid() for another approach to repair polygon geometries.

Examples

## 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)