View source: R/mf_get_pencil.R
mf_get_pencil | R Documentation |
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)
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. |
A MULTILINESTRING sf object is returned.
mtq <- mf_get_mtq()
mtq_pencil <- mf_get_pencil(x = mtq, clip = FALSE)
mf_map(mtq)
mf_map(mtq_pencil, add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.