Learn R Programming

mapsf (version 1.0.0)

mf_get_pencil: Get a pencil layer from polygons

Description

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

Usage

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

Value

A MULTILINESTRING sf object is returned.

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.

Examples

Run this code
mtq <- mf_get_mtq()
mtq_pencil <- mf_get_pencil(x = mtq, clip = FALSE)
mf_map(mtq)
mf_map(mtq_pencil, add = TRUE)

Run the code above in your browser using DataLab