red-list-ecosystem / redlistr

redlistr: Tools for the IUCN Red List of Ecosystems and Species
Other
31 stars 6 forks source link

Update package to use the "terra" package instead of "raster" #14

Open calvinkflee opened 2 years ago

calvinkflee commented 2 years ago

While updating the package to use 'sf' instead of 'sp', it is probably also worth updating it to use terra instead of raster.

Will likely be able to improve the performance of some of the slower functions as well.

AMBarbosa commented 2 years ago

Hi, Note that 'terra' can also be used for spatial vector data, instead of 'sf'. It's probably easier (thus faster) to update everything for 'terra', rather than for 'terra' (for raster maps) plus 'sf' (for vector maps), which implies loading / depending on more packages and using different syntaxes. See e.g. here.

calvinkflee commented 1 year ago

Terra can now be used for the input for most functions. gridUncertainty still uses raster, as it'll take a lot more time playing with that to update it.

I agree that it's probably more straightforward to stick with terra throughout the package, though having sf as an additional option if some users want it can also be beneficial.