1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/flatten.R
3\name{wk_flatten}
4\alias{wk_flatten}
5\alias{wk_flatten_filter}
6\title{Extract simple geometries}
7\usage{
8wk_flatten(handleable, ..., max_depth = 1)
9
10wk_flatten_filter(handler, max_depth = 1L, add_details = FALSE)
11}
12\arguments{
13\item{handleable}{A geometry vector (e.g., \code{\link[=wkb]{wkb()}}, \code{\link[=wkt]{wkt()}}, \code{\link[=xy]{xy()}},
14\code{\link[=rct]{rct()}}, or \code{\link[sf:sfc]{sf::st_sfc()}}) for which \code{\link[=wk_handle]{wk_handle()}} is defined.}
15
16\item{...}{Passed to the \code{\link[=wk_handle]{wk_handle()}} method.}
17
18\item{max_depth}{The maximum (outer) depth to remove.}
19
20\item{handler}{A \link[=wk_handle]{wk_handler} object.}
21
22\item{add_details}{Use \code{TRUE} to add a "wk_details" attribute, which
23contains columns \code{feature_id}, \code{part_id}, and \code{ring_id}.}
24}
25\value{
26\code{handleable} transformed such that collections have been
27expanded and only simple geometries (point, linestring, polygon)
28remain.
29}
30\description{
31Extract simple geometries
32}
33\examples{
34wk_flatten(wkt("MULTIPOINT (1 1, 2 2, 3 3)"))
35wk_flatten(
36  wkt("GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POINT (0 1))))"),
37  max_depth = 2
38)
39
40}
41