Learn R Programming

lawn (version 0.6.0)

lawn_dissolve: 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

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

Run this code
# NOT RUN {
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')
# }

Run the code above in your browser using DataLab