lawn_polygonize: Polygonizes multi-linestring's to polygons

Description Usage Arguments Details Value Examples

View source: R/polygonize.R

Description

Takes a data-LineString or data-MultiLineString and returns data-Polygon's

Usage

1

Arguments

lines

Line(s) to polygonze

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

Polygonizes a set of lines that represents edges in a planar graph. Edges must be correctly noded, i.e., they must only meet at their endpoints.

Value

one or more data-Polygon

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
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
## Not run: 
 # line <- '{
 #   "type": "FeatureCollection",
 #   "features": [
 #     {
 #      "type": "Feature",
 #      "properties": {
 #        "stroke": "#F00"
 #     },
 #      "geometry": {
 #        "type": "LineString",
 #        "coordinates": [[-83, 30], [-84, 36], [-78, 41]]
 #      }
 #    },
 #     {
 #      "type": "Feature",
 #      "properties": {
 #        "stroke": "#F00"
 #     },
 #      "geometry": {
 #        "type": "LineString",
 #        "coordinates": [[-86, 34], [-88, 33], [-73, 39]]
 #      }
 #    }
 #  ]
 # }'
 #
 # line <- '{
 #   "type": "FeatureCollection",
 #   "features": [
 #     {
 #      "type": "Feature",
 #      "geometry": {
 #        "type": "LineString",
 #        "coordinates": [[0, 0], [1, 1]]
 #      }
 #    },
 #     {
 #      "type": "Feature",
 #      "geometry": {
 #        "type": "LineString",
 #        "coordinates": [[1, 1], [-1, -1]]
 #      }
 #    },
 #     {
 #      "type": "Feature",
 #      "geometry": {
 #        "type": "LineString",
 #        "coordinates": [[-1, -1], [0, 0]]
 #      }
 #    }
 #  ]
 # }'


 # x <- '{
 #   "type": "FeatureCollection",
 #   "features": [
 #     {
 #       "type": "Feature",
 #       "properties": {},
 #       "geometry": {
 #         "type": "LineString",
 #         "coordinates": [
 #           [
 #             119.00390625,
 #             -22.024545601240337
 #           ],
 #           [
 #             120.58593749999999,
 #             -28.613459424004414
 #           ],
 #           [
 #             125.595703125,
 #             -32.99023555965107
 #           ],
 #           [
 #             133.330078125,
 #             -32.99023555965107
 #           ],
 #           [
 #             142.646484375,
 #             -30.977609093348676
 #           ],
 #           [
 #             142.294921875,
 #             -24.126701958681668
 #           ],
 #           [
 #             139.04296875,
 #             -16.299051014581817
 #           ],
 #           [
 #             128.84765625,
 #             -15.199386048559994
 #           ]
 #         ]
 #       }
 #     },
 #     {
 #       "type": "Feature",
 #       "properties": {},
 #       "geometry": {
 #         "type": "LineString",
 #         "coordinates": [
 #           [
 #             142.646484375,
 #             -30.977609093348676
 #           ],
 #           [
 #             132.451171875,
 #             -27.449790329784214
 #           ],
 #           [
 #             128.671875,
 #             -23.1605633090483
 #           ],
 #           [
 #             119.00390625,
 #             -22.024545601240337
 #           ]
 #         ]
 #       }
 #     }
 #   ]
 # }'
 # lawn_polygonize(lines = x)

## End(Not run)

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