Examples for 'sf::st_as_sfc'


Convert foreign geometry object to an sfc object

Aliases: st_as_sfc st_as_sfc.pq_geometry st_as_sfc.list st_as_sfc.blob st_as_sfc.bbox st_as_sfc.WKB st_as_sfc.raw st_as_sfc.character st_as_sfc.factor st_as_sfc.SpatialPoints st_as_sfc.SpatialPixels st_as_sfc.SpatialMultiPoints st_as_sfc.SpatialLines st_as_sfc.SpatialPolygons st_as_sfc.map st_as_sfc.s2_geography

Keywords:

### ** Examples

wkb = structure(list("01010000204071000000000000801A064100000000AC5C1441"), class = "WKB")
st_as_sfc(wkb, EWKB = TRUE)
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 181072 ymin: 333611 xmax: 181072 ymax: 333611
Projected CRS: Amersfoort / RD New
POINT (181072 333611)
wkb = structure(list("0x01010000204071000000000000801A064100000000AC5C1441"), class = "WKB")
st_as_sfc(wkb, EWKB = TRUE)
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 181072 ymin: 333611 xmax: 181072 ymax: 333611
Projected CRS: Amersfoort / RD New
POINT (181072 333611)
st_as_sfc(st_as_binary(st_sfc(st_point(0:1)))[[1]], crs = 4326)
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
Geodetic CRS:  WGS 84
POINT (0 1)
st_as_sfc("SRID=3978;LINESTRING(1663106 -105415,1664320 -104617)")
Geometry set for 1 feature 
Geometry type: LINESTRING
Dimension:     XY
Bounding box:  xmin: 1663106 ymin: -105415 xmax: 1664320 ymax: -104617
Projected CRS: NAD83 / Canada Atlas Lambert
LINESTRING (1663106 -105415, 1664320 -104617)

[Package sf version 1.0-19 Index]