Learn R Programming

lawn (version 0.6.0)

lawn_flatten: Flatten

Description

Flattens any GeoJSON to a FeatureCollection

Usage

lawn_flatten(x, lint = FALSE)

Arguments

x

any valid GeoJSON with multi-geometry data-Feature's

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

See Also

Other misc: lawn_truncate()

Examples

Run this code
# NOT RUN {
x <- '{"type":"MultiPolygon","coordinates":[
  [[[102,2],[103,2],[103,3],[102,3],[102,2]]],
  [[[100,0],[101,0],[101,1],[100,1],[100,0]],
  [[100.2,0.2],[100.2,0.8],[100.8,0.8],[100.8,0.2],[100.2,0.2]]]
 ]
}'
lawn_flatten(x)
lawn_flatten(x, TRUE)
# }

Run the code above in your browser using DataLab