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

View source: R/dissolve.R

lawn_dissolveR Documentation

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

Description

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

Usage

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

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')

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