lawn_dissolve: Dissolves a FeatureCollection of polygons based on a...

Description Usage Arguments Value See Also Examples

View source: R/dissolve.R

Description

Dissolves a FeatureCollection of polygons based on a property. Note that multipart features within the collection are not supported

Usage

1
lawn_dissolve(features, key, lint = FALSE)

Arguments

features

A data-FeatureCollection<(data-Polygon)>

key

(character) The property on which to filter

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)> containing the dissolved polygons

See Also

Other assertions: lawn_circle(), lawn_tesselate()

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
cat(lawn_data$filter_features)
x <- '{
 "type": "FeatureCollection",
 "features": [
  {
    "type": "Feature",
    "properties": {
      "combine": "yes"
    },
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]
    }
  },
  {
    "type": "Feature",
    "properties": {
      "combine": "yes"
    },
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[0, -1], [0, 0], [1, 0], [1, -1], [0,-1]]]
    }
  },
  {
    "type": "Feature",
    "properties": {
      "combine": "no"
    },
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[1,-1],[1, 0], [2, 0], [2, -1], [1, -1]]]
    }
  }
  ]
}'
lawn_dissolve(x, key = 'combine')

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