isciences / exactextractr

R package for fast and accurate raster zonal statistics
https://isciences.gitlab.io/exactextractr/
281 stars 26 forks source link

sfc_GEOMETRY not accomodated #20

Closed axlehner closed 4 years ago

axlehner commented 4 years ago

Hi, when the class of the geometry is sfc_GEOMETRY instead of (MULTI)POLYGON (in your vignette example it is a multipolygon), the function fails with error message

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘exact_extract’ for signature ‘"RasterLayer", "sfc_GEOMETRY"’
dbaston commented 4 years ago

I'm not sure how to support sfc_GEOMETRY, because sf doesn't provide seem to provide a method to serialize sfc_geometry to WKB. Can you describe the use case a bit? Where is your sfc_GEOMETRY coming from?