lawn_convex: Convex hull polygon

View source: R/convex.R

lawn_convexR Documentation

Convex hull polygon

Description

Takes a set of data-Point's and returns a convex hull polygon. Internally, this uses the convex-hull (https://github.com/mikolalysenko/convex-hull) module that implements a Monotone chain hull

Usage

lawn_convex(input, lint = FALSE)

Arguments

input

Input points in a data-FeatureCollection.

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

a convex hull data-Polygon

See Also

Other transformations: lawn_bezier(), lawn_buffer(), lawn_concave(), lawn_difference(), lawn_intersect(), lawn_merge(), lawn_simplify(), lawn_union()

Examples

points <- '{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.601226, 44.642643]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.591442, 44.651436]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.580799, 44.648749]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.573589, 44.641788]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.587665, 44.64533]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-63.595218, 44.64765]
      }
    }
    ]
}'
lawn_convex(points)
## Not run: 
lawn_convex(points) %>% view

## End(Not run)

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