Skip to contents

Simplifies LineStrings, Polygons, and their Multi- counterparts.

Usage

simplify_geoms(x, epsilon)

simplify_vw_geoms(x, epsilon)

simplify_vw_preserve_geoms(x, epsilon)

Arguments

x

an object of class of rsgeo

epsilon

a tolerance parameter. Cannot be equal to or less than 0.

Value

an object of class rsgeo

Details

Simplify functions use the Ramer–Douglas–Peucker algorithm. Functions with vw use the Visvalingam-Whyatt algorithm.

For more see geo docs.

Examples

x <- geom_linestring(1:100, runif(100, 5, 10))

simplify_geoms(x, 3)
#> <rs_LINESTRING[1]>
#> [1] LineString([Coord { x: 1.0, y: 7.648597900988534 }, Coord { x: 8.0, y: 9.3...
simplify_vw_geoms(x, 2)
#> <rs_LINESTRING[1]>
#> [1] LineString([Coord { x: 1.0, y: 7.648597900988534 }, Coord { x: 2.0, y: 8.9...
simplify_vw_preserve_geoms(x, 100)
#> <rs_LINESTRING[1]>
#> [1] LineString([Coord { x: 1.0, y: 7.648597900988534 }, Coord { x: 36.0, y: 9....