Learn R Programming

sf (version 0.2-7)

st_cast: Cast geometry to another type: either simplify, or cast explicitly

Description

Cast geometry to another type: either simplify, or cast explicitly

Usage

st_cast(x, to, ...)

Arguments

x
object of class sfg, sfc or sf
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.
...
ignored

Value

object of class to if successful, or unmodified object if unsuccesful. If information gets lost while type casting, a warning is raised.

Examples

Run this code
s = st_multipoint(rbind(c(1,0)))
st_cast(s, "POINT")

Run the code above in your browser using DataLab