ropensci / spocc

Species occurrence data toolkit for R
https://docs.ropensci.org/spocc
Other
115 stars 27 forks source link

make occ handle sf objects as well? #222

Closed sckott closed 3 years ago

sckott commented 4 years ago

only if we can do without depending on sf, even in suggests, - as we avoid sp by using wicket

sckott commented 4 years ago
library(sf)
outer = matrix(c(0,0,10,0,10,10,0,10,0,0),ncol=2, byrow=TRUE)
hole1 = matrix(c(1,1,1,2,2,2,2,1,1,1),ncol=2, byrow=TRUE)
hole2 = matrix(c(5,5,5,6,6,6,6,5,5,5),ncol=2, byrow=TRUE)
pts = list(outer, hole1, hole2)
(pl1 = st_polygon(pts))
st_as_text(pl1) 
# gives WKT needed, but this requires sf
# and internally st_as_text requires lwgeom, which will still require sf and the hard to install stack
sckott commented 4 years ago

not sure this is possible without requiring sf