lawn_planepoint: Calculate a Planepoint

View source: R/planepoint.R

lawn_planepointR Documentation

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

Details

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

Value

The z-value for pt (numeric).

See Also

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

Examples

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)

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.