mf_get_pencil function

Get a pencil layer from polygons

Get a pencil layer from polygons

Create a pencil layer. This function transforms a POLYGON or MULTIPOLYGON sf object into a MULTILINESTRING one.

mf_get_pencil(x, size = 100, buffer = 0, lefthanded = TRUE, clip = FALSE)

Arguments

  • x: an sf object, a simple feature collection (POLYGON or MULTIPOLYGON).
  • size: density of the penciling. Median number of points used to build the MULTILINESTRING.
  • buffer: buffer around each polygon. This buffer (in map units) is used to take sample points. A negative value adds a margin between the penciling and the original polygons borders
  • lefthanded: if TRUE the penciling is done left-handed style.
  • clip: if TRUE, the penciling is cut by the original polygon.

Returns

A MULTILINESTRING sf object is returned.

Examples

mtq <- mf_get_mtq() mtq_pencil <- mf_get_pencil(x = mtq, clip = FALSE) mf_map(mtq) mf_map(mtq_pencil, add = TRUE)
  • Maintainer: Timothée Giraud
  • License: GPL (>= 3)
  • Last published: 2024-10-22