Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


sf (version 0.1-1)

st_as_sfc: convert foreign geometry object to an sfc object

Description

convert foreign geometry object to an sfc object

Usage

st_as_sfc(x, ...)
"st_as_sfc"(x, ...)
"st_as_sfc"(x, ...)
"st_as_sfc"(x, ...)
"st_as_sfc"(x, ..., forceMulti = FALSE)
"st_as_sfc"(x, ..., forceMulti = FALSE)
"st_as_sfc"(x, ..., EWKB = FALSE)

Arguments

x
object to convert
...
further arguments
forceMulti
logical; if TRUE, force coercion into MULTIPOLYGON or MULTILINE objects, else autodetect
EWKB
logical; if TRUE, parse as EWKB (PostGIS: ST_AsEWKB), otherwise as ISO WKB (PostGIS: ST_AsBinary)

Details

when converting from WKB, the object x is either a character vector such as typically obtained from PostGIS (either with leading "0x" or without), or a list with raw vectors representing the features in binary form.

Examples

Run this code
wkb = structure(list("01010000204071000000000000801A064100000000AC5C1441"), class = "WKB")
st_as_sfc(wkb, EWKB = TRUE)
wkb = structure(list("0x01010000204071000000000000801A064100000000AC5C1441"), class = "WKB")
st_as_sfc(wkb, EWKB = TRUE)

Run the code above in your browser using DataLab