Learn R Programming

lawn (version 0.1.7)

lawn_planepoint: Calculate a Planepoint

Description

Takes a triangular plane as a data-Polygon and a data-Point within that triangle and returns the z-value at that point

Usage

lawn_planepoint(pt, triangle, lint = FALSE)

Arguments

pt
the Point for which a z-value will be calculated
triangle
a Polygon feature with three vertices
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

the z-value for pt (numeric)

Details

The Polygon needs to have properties a, b, and c that define the values at its three corners.

See Also

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

Examples

Run this code
pt <- lawn_point(c(-75.3221, 39.529))
triangle <- '{
  "type": "Feature",
  "properties": {
    "a": 11,
    "b": 122,
    "c": 44
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-75.1221, 39.57],
      [-75.58, 39.18],
      [-75.97, 39.86],
      [-75.1221, 39.57]
    ]]
  }
}'
lawn_planepoint(pt, triangle)

Run the code above in your browser using DataLab