Rsagacmd icon indicating copy to clipboard operation
Rsagacmd copied to clipboard

Error in `saga_execute()`:

Open rchicalo opened this issue 11 months ago • 1 comments

Hi There,

I'm trying to use rsagacmd package with a SpatRaster dem. When I run saga <- saga_gis(raster_backend = "terra"), the object is created. Yet, when I run saga_dah_rast <- saga$ta_morphometry$diurnal_anisotropic_heat(dem = dem_rast)

I get the following error message: Error in saga_execute(): ! Error: input file [C:\Users\RCHICALO\Documents\dem_UPSA.tif] Error: Elevation Backtrace:

  1. saga$ta_morphometry$terrain_ruggedness_index_tri(...)
  2. Rsagacmd::saga_execute(lib, tool, senv, .intern, .all_outputs, .verbose, args)

Can you offer potential solutions? I thought that there was an issue with the package calling on SAGA-GIS tools that I downloaded from here (https://sourceforge.net/projects/saga-gis/), but now understand that the saga_gis function wouldn't run if there was an issue with that. Do I have that right?

Please help!

Roxy

rchicalo avatar Mar 07 '24 21:03 rchicalo

Hello, this seems to work for me (using the example DEM):

library(Rsagacmd)
library(terra)

saga <- saga_gis(raster_backend = "terra")
dem <- read_srtm()

saga_dah_rast <- saga$ta_morphometry$diurnal_anisotropic_heat(dem = dem)
plot(saga_dah_rast)

Are you still having problems?

stevenpawley avatar Mar 23 '24 16:03 stevenpawley