st_cast_ext: Cast geometry to another type

View source: R/st_cast_ext.R

st_cast_extR Documentation

Cast geometry to another type

Description

Wrapper for sf::st_cast() that currently supports casting MULTIPOLYGON to POLYGON or MULTIPOLYGON or POLYGON to POINT or, if simplify = FALSE, can cast MULTIPOINT to LINESTRING. This is not very different than the basic functionality of st_cast but further development may improve the utility of this function.

Usage

st_cast_ext(x, to = "POINT", simplify = TRUE, ...)

Arguments

x

A sf or sfc object to cast to another type.

to

character; target type, if missing, simplification is tried; when x is of type sfg (i.e., a single geometry) then to needs to be specified.

simplify

If TRUE, simplify geometry type; defaults to TRUE.

...

ignored

See Also

sf::st_cast()


elipousson/overedge documentation built on Aug. 13, 2022, 7:41 p.m.