lawn_concave: Concave hull polygon

Description Usage Arguments Value See Also Examples

View source: R/concave.R

Description

Takes a set of data-Point's and returns a concave hull polygon. Internally, this implements a Monotone chain algorithm

Usage

1
lawn_concave(points, maxEdge = 1, units = "miles", lint = FALSE)

Arguments

points

Input points in a data-FeatureCollection.

maxEdge

The size of an edge necessary for part of the hull to become concave (in miles).

units

Used for maxEdge distance (miles (default) or kilometers).

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 concave hull data-Polygon

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 
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_concave(points, 1)

lawn_concave(points) %>% view

## End(Not run)

Example output

<LineString>
  Bounding box: -63.6 44.6 -63.6 44.7
  No. points: 12
  Properties: NULL

lawn documentation built on Jan. 6, 2021, 5:07 p.m.