Learn R Programming

lawn (version 0.5.0)

lawn_tin: Create a Triangulated Irregular Network

Description

Takes a set of data-Point's and the name of a z-value property and creates a Triangulated Irregular Network (TIN).

Usage

lawn_tin(pt, propertyName = NULL, lint = FALSE)

Arguments

pt

Input points.

propertyName

(character) Name of the property from which to pull z values. This is optional: if not given, then there will be no extra data added to the derived triangles

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

TIN output, as a data-FeatureCollection.

Details

Data returned as a collection of Polygons. These are often used for developing elevation contour maps or stepped heat visualizations.

This triangulates the points, as well as adds properties called a, b, and c representing the value of the given propertyName at each of the points that represent the corners of the triangle.

See Also

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

Examples

Run this code
# NOT RUN {
pts <- lawn_random(bbox = c(-70, 40, -60, 60))
lawn_tin(pts)
# }
# NOT RUN {
lawn_tin(pts) %>% view
lawn_tin(lawn_random(bbox = c(-70, 40, -60, 10))) %>% view
# }

Run the code above in your browser using DataLab