Examples for 'sf::st_as_binary'


Convert sfc object to an WKB object

Aliases: st_as_binary st_as_binary.sfc st_as_binary.sfg

Keywords:

### ** Examples

# examples of setting precision:
st_point(c(1/3, 1/6)) %>% st_sfc(precision = 1000) %>% st_as_binary %>% st_as_sfc
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 0.333 ymin: 0.167 xmax: 0.333 ymax: 0.167
CRS:           NA
POINT (0.333 0.167)
st_point(c(1/3, 1/6)) %>% st_sfc(precision =  100) %>% st_as_binary %>% st_as_sfc
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 0.33 ymin: 0.17 xmax: 0.33 ymax: 0.17
CRS:           NA
POINT (0.33 0.17)
st_point(1e6 * c(1/3, 1/6)) %>% st_sfc(precision = 0.01) %>% st_as_binary %>% st_as_sfc
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 333300 ymin: 166700 xmax: 333300 ymax: 166700
CRS:           NA
POINT (333300 166700)
st_point(1e6 * c(1/3, 1/6)) %>% st_sfc(precision = 0.001) %>% st_as_binary %>% st_as_sfc
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 333000 ymin: 167000 xmax: 333000 ymax: 167000
CRS:           NA
POINT (333000 167000)

[Package sf version 1.0-19 Index]