clgeo_Clean {cleangeo} | R Documentation |
clgeo_Clean
Description
Function to clean a spatial data collection
Usage
clgeo_Clean(sp, errors.only = NULL, strategy = "SF", verbose = FALSE)
Arguments
sp |
object extending the |
errors.only |
an object of class |
strategy |
advanced strategy to clean geometries. Default is "SF", alternate values are "POLYGONATION, "BUFFER" (old methods). |
verbose |
Indicates wether the clean logs have to be printed. Default value is FALSE. |
Value
an object extending the Spatial-class
as defined in sp, with cleaned geometries.
Note
About cleaning strategy:
The polygonation method is a tentative alternate method to triangulation to clean
geometries and to the classical often used 'buffer' approach. In the polygonation
method, triangulation is skipped and a re-polygonation intuitive algorithm is
applied to rebuild the source invalid geometry into one or more valid polygonal
geometries.
With the progress done on validating geometries, especially with sf, the default
method in cleangeo has now been switched to the use of sf::st_make_valid
Author(s)
Emmanuel Blondel emmanuel.blondel1@gmail.com
Examples
require(sf)
file <- system.file("extdata", "example.shp", package = "cleangeo")
sf <- sf::st_read(file)
sp <- as(sf, "Spatial")
sp.clean <- clgeo_Clean(sp)
report.clean <- clgeo_CollectionReport(sp.clean)
clgeo_SummaryReport(report.clean)