lawn_flatten: Flatten

Description Usage Arguments Value See Also Examples

View source: R/flatten.R

Description

Flattens any GeoJSON to a FeatureCollection

Usage

1
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

1
2
3
4
5
6
7
8
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)

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