Reduces the number of points in each geometry by removing vertices that
deviate less than epsilon from the simplified path. Accepts linestrings,
multilinestrings, polygons, and multipolygons.
See also
Other simplify:
ga_simplify_idx(),
ga_simplify_vw()
Examples
fp <- system.file("shape/nc.shp", package = "sf")
nc <- as.data.frame(read_shapefile(fp))
# a bigger epsilon drops more vertices
head(as.vector(ga_n_coords(nc$geometry)), 3)
#> [1] 27 26 28
head(as.vector(ga_n_coords(ga_simplify(nc$geometry, 0.01))), 3)
#> [1] 19 14 14
head(as.vector(ga_n_coords(ga_simplify(nc$geometry, 0.1))), 3)
#> [1] 5 5 5