Learn R Programming

lawn (version 0.1.7)

lawn_isolines: Generate Isolines

Description

Takes data-Point's with z-values and an array of value breaks and generates isolines

Usage

lawn_isolines(points, z, resolution, breaks, lint = FALSE)

Arguments

points
Input points
z
(character) the property name in points from which z-values will be pulled
resolution
(numeric) resolution of the underlying grid
breaks
(numeric) where to draw contours
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-FeatureCollection of isolines (data-LineString features)

See Also

Other interpolation: lawn_hex_grid, lawn_planepoint, lawn_point_grid, lawn_square_grid, lawn_tin, lawn_triangle_grid

Examples

Run this code
pts <- lawn_random(n = 100, bbox = c(0, 30, 20, 50))
pts$features$properties <- data.frame(z = round(rnorm(100, mean = 5)), stringsAsFactors = FALSE)
breaks <- c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
lawn_isolines(pts, 'z', 15, breaks)

Run the code above in your browser using DataLab