Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikosGeography opened this issue Nov 23, 2024 · 0 comments
Open

Comments

@nikosGeography
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant