spatialEco icon indicating copy to clipboard operation
spatialEco copied to clipboard

raster.gaussian.smooth and type = convolution shows a bug message

Open nikosGeography opened this issue 1 year ago • 0 comments

Hi, I was playing around with the raster.gaussian.smooth() and I noticed when I set type = "convolution" I get this error message:

Running a Gaussian decomposition
Temporary bug in terra::focal failing convolution function
Error: [focal] test failed

no matter what value I set to the other parameters of the function. Is this truly terra's focal() function or I can't set convolution to my data?

The code I am using:

pacman::p_load(terra, spatialEco)

wd <- "path/"

r <- rast(paste0(wd, "ghs.tif"))

rs <- raster.gaussian.smooth(r, s = 1, scale = TRUE, type = "convolution")
plot(rs)
> sessionInfo()
R version 4.4.2 (2024-10-31 ucrt)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.16.2 spatialEco_2.0-3  dplyr_1.1.4       terra_1.7-83 

I used 6-7 different rasters with various pixel size (30m, 130m, 450m) and I got the same error.

nikosGeography avatar Nov 23 '24 15:11 nikosGeography