lawn_unkinkpolygon: Unkink polygon

Description Usage Arguments Value Examples

View source: R/unkinkpolygon.R

Description

Takes a kinked polygon and returns a feature collection of polygons that have no kinks.

Usage

1

Arguments

x

A data-FeatureCollection<(data-Polygon)> or data-FeatureCollection<(data-MultiPolygon)>

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 data-FeatureCollection<(data-Polygon)>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- '{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Polygon",
      "coordinates": [[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]
   }
}'
lawn_unkinkpolygon(x)
view(x)
view(lawn_unkinkpolygon(x))

Example output

<FeatureCollection>
  Bounding box: 0.0 0.0 2.0 2.0
  No. features: 2
  No. points: 16
  Properties: NULL

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