wk_flatten: Extract simple geometries

View source: R/flatten.R

wk_flattenR Documentation

Extract simple geometries

Description

Extract simple geometries

Usage

wk_flatten(handleable, ..., max_depth = 1)

wk_flatten_filter(handler, max_depth = 1L, add_details = FALSE)

Arguments

handleable

A geometry vector (e.g., wkb(), wkt(), xy(), rct(), or sf::st_sfc()) for which wk_handle() is defined.

...

Passed to the wk_handle() method.

max_depth

The maximum (outer) depth to remove.

handler

A wk_handler object.

add_details

Use TRUE to add a "wk_details" attribute, which contains columns feature_id, part_id, and ring_id.

Value

handleable transformed such that collections have been expanded and only simple geometries (point, linestring, polygon) remain.

Examples

wk_flatten(wkt("MULTIPOINT (1 1, 2 2, 3 3)"))
wk_flatten(
  wkt("GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POINT (0 1))))"),
  max_depth = 2
)


wk documentation built on Oct. 12, 2024, 1:07 a.m.