Skip to contents

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