Generalize Vector
Explainers
Simplification methods
There are a few ways we can approach reducing the data footprint of the geometric representation of a feature. These can include:
- The Douglas-Peucker algorithm, as implemented in:
- ogr (
ogr2ogr '{input_data_path.gpkg}' '{outputput_data_path.gpkg}' -simplify 50) - sf (
sf::st_simplify(input_data, preserveTopology = TRUE, dTolerance = 50)).
- ogr (
- Visvalingam simplification implemented by mapshaper and exposed by the rmapshaper package:
rmapshaper::ms_simplify(input_data, keep = keep_val, keep_shapes = TRUE) - Chaikin’s corner cutting algorithm, as implemented in:
- The smoothr package also exposes:
- Kernel smoothing using Gaussian kernel regression
- Spline interpolation
- Randomly dropping nodes from the geometry.
Each of these “modeler choices” has an impact on the outcome, but that outcome can also be dependent on the nature and scale of your input data; let’s try and quantify that impact here:
The Impact of method on outcome:
- By Tool: Testing algorithmic parity across tools.
- Over States: State boundaries are typically scaled for cartographic representations, which might throw off traditional methods.
- Over Shapes: Complex polygonal shapes need particular modeler care when applying these tools.
- Over Roads: Roads can be densely digitized but have also been standardized across federal efforts.
- Over Rivers: FIM derived rivers are generated by following the DEM and then vectorizing it, resulting in a very dense and stair-step-y geometry.