File: wkt_unnest.Rd

package info (click to toggle)
r-cran-wkutils 0.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 816 kB
  • sloc: cpp: 3,625; sh: 12; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unnest.R
\name{wkt_unnest}
\alias{wkt_unnest}
\alias{wkb_unnest}
\title{Flatten nested geometry structures}
\usage{
wkt_unnest(wkt, keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)

wkb_unnest(wkb, keep_empty = FALSE, keep_multi = TRUE, max_depth = 1)
}
\arguments{
\item{wkt}{A character vector containing well-known text.}

\item{keep_empty}{If \code{TRUE}, a GEOMETRYCOLLECTION EMPTY is left as-is
rather than collapsing to length 0.}

\item{keep_multi}{If \code{TRUE}, MULTI* geometries are not expanded to sub-features.}

\item{max_depth}{The maximum recursive GEOMETRYCOLLECTION depth to unnest.}

\item{wkb}{A \code{list()} of \code{\link[=raw]{raw()}} vectors, such as that
returned by \code{sf::st_as_binary()}.}
}
\value{
An unclassed vector with attribute \code{lengths}, which is an integer vector
with the same length as the input denoting the length to which each
feature was expanded.
}
\description{
Flatten nested geometry structures
}
\examples{
wkt_unnest("GEOMETRYCOLLECTION (POINT (1 2), POINT (3 4))")
wkt_unnest("GEOMETRYCOLLECTION EMPTY")
wkt_unnest("GEOMETRYCOLLECTION EMPTY", keep_empty = TRUE)

}