Skip to content
Prev 27466 / 29559 Next

st_simplify outputs the input geometry with no simplification

It has changed it, there's now a mix of POLYGON and MULTIPOLYGON
geometries, but no change in the underlying coordinates. You have to use
the dTolerance argument:

nrow(st_coordinates(nc))
[1] 2529
nrow(st_coordinates(st_cast(nc_simplfy)))
[1] 2529
nrow(st_coordinates(st_cast(st_simplify(nc, dTolerance = 1000))))
[1] 1941

It still might change the geometry with dTolerance = 0 (the default), in
that case it will remove vertices that are collinear (unnecessarily dense
straight lines, reduce to two-vertex edges).  I only learnt that recently.

HTH
On Mon, Jul 22, 2019 at 8:15 PM Hugo Costa <hugoagcosta at gmail.com> wrote: