cnt_skeleton {centerline}R Documentation

Create a skeleton of a closed polygon object

Description

This function generates skeletons of closed polygon objects.

Usage

cnt_skeleton(input, keep = 0.5, method = "voronoi")

Arguments

input

sf, sfc, SpatVector, or geos_geometry polygons object

keep

numeric, proportion of points to retain (0.05-5.0; default 0.5). See Details.

method

character, either "voronoi" (default) or "straight", or just the first letter "v" or "s". See Details.

Details

Polygon simplification/densification

Skeleton method

Value

a sf, sfc, SpatVector or geos_geometry class object of a MULTILINESTRING geometry

References

Voronoi, G. (1908). Nouvelles applications des paramètres continus à la théorie des formes quadratiques. Journal für die reine und angewandte Mathematik, 134, 198-287. doi:10.1515/crll.1908.134.198

Examples

library(sf)

polygon <-
  sf::st_read(system.file("extdata/example.gpkg", package = "centerline"),
    layer = "polygon",
    quiet = TRUE
  )

plot(polygon)

pol_skeleton <- cnt_skeleton(polygon)

plot(pol_skeleton)

[Package centerline version 0.2.2 Index]