geo_unnest: Unnest recursive geometry structures

Description Usage Arguments Examples

View source: R/geo-unnest.R

Description

Unnest recursive geometry structures

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

## Default S3 method:
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

## S3 method for class 'wk_wkt'
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

## S3 method for class 'wk_wkb'
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

## S3 method for class 'wk_wksxp'
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

## S3 method for class 'data.frame'
geo_unnest(x, ..., keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

Arguments

x

A geometry-like object, or one that can be coerced to a geometry-like object using as_geovctr().

...

Unused

keep_empty

If TRUE, a GEOMETRYCOLLECTION EMPTY is left as-is rather than collapsing to length 0.

keep_multi

If TRUE, MULTI* geometries are not expanded to sub-features.

max_depth

The maximum recursive GEOMETRYCOLLECTION depth to unnest.

Examples

1
2
3
4
5
6
geo_unnest("GEOMETRYCOLLECTION (POINT (1 2), POINT (3 4))")
geo_unnest("GEOMETRYCOLLECTION EMPTY")
geo_unnest("GEOMETRYCOLLECTION EMPTY", keep_empty = TRUE)

geo_unnest(geo_example_wkt, keep_multi = TRUE)
geo_unnest(geo_example_wkt, keep_multi = FALSE)

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.