gjearevoll / BioDivMapping

A pipeline dedicated to analysing and visualising the biodiversity of different taxa in Norway
GNU General Public License v3.0
5 stars 3 forks source link

Habitat heterogeneity addition #118

Closed samaperrin closed 7 months ago

samaperrin commented 7 months ago

Why have changes been made?

One of the final environmental covariates that we need is habitat heterogeneity. We have found a metric based on the rasterdiv package by Rocchini et al. THis is a simple implementation based on the available CORINE data which generates habitat heterogeneity based on the surrounding pixels.

What changes have been made?

Additional changes

samaperrin commented 7 months ago

not sure why, but my R will only install rasterdiv from github: remotes::install_github("mattmar/rasterdiv") in that latest version, the Shannon() function does not work with a raster::RasterLayer but does work with terra::SpatRaster. This means you can't use CRAN version of rasterdiv right now, but I suspect the package will move in that direction. I've updated the PR, and if you are content with using the development version of rasterdiv, then I'm happy to merge.

Yeah this sounds better to be honest, if it's working with terra then I assume it's faster. Will give it a test run on Monday and then merge.