simplify: Simplify simple features data frame

View source: R/MazamaSpatialUtils.R

simplifyR Documentation

Simplify simple features data frame

Description

Simplify a simple features dataframe. This is a convenience wrapper for ms_simplify

Usage

simplify(SFDF, keep = 0.05, ...)

Arguments

SFDF

Object of class simple features data frame.

keep

Proportion of points to retain (0-1; default 0.05)

...

Arguments passed to rmapshaper::ms_simplify()

Value

A simplified simple features dataframe.

Examples

## Not run: 
library(MazamaSpatialUtils)
FR <-
  SimpleCountries %>%
  dplyr::filter(countryCode == "FR")
par(mfrow = c(3, 3), mar = c(1, 1, 3, 1))
for (i in 9:1) {
  keep <- 0.1 * i
  geom <-
    FR %>%
    simplify(keep) %>%
    sf::st_geometry()
  plot(geom, main=paste0("keep = ", keep))
}
layout(1)
par(mar = c(5,4,4,2)+.1)

## End(Not run)

MazamaSpatialUtils documentation built on Sept. 8, 2023, 5:22 p.m.