Learn R Programming

lawn (version 0.1.7)

lawn_bezier: Curve a linestring

Description

Takes a data-LineString and returns a curved version by applying a Bezier spline algorithm

Usage

lawn_bezier(line, resolution = 10000L, sharpness = 0.85, lint = FALSE)

Arguments

line
resolution
time in milliseconds between points
sharpness
a measure of how curvy the path should be between splines
lint
(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

data-LineString curved line

See Also

Other transformations: lawn_buffer, lawn_concave, lawn_convex, lawn_erase, lawn_intersect, lawn_merge, lawn_simplify, lawn_union

Examples

Run this code
pts <- '[
   [-21.964416, 64.148203],
   [-21.956176, 64.141316],
   [-21.93901, 64.135924],
   [-21.927337, 64.136673]
]'
lawn_bezier(lawn_linestring(pts))
lawn_bezier(lawn_linestring(pts), 9000L)
lawn_bezier(lawn_linestring(pts), 9000L, 0.65)

Run the code above in your browser using DataLab