0

I'm trying to execute module for Channel networks in RSAGA but when I run this part of code:

rsaga.geoprocessor(lib="ta_channels", module=5, param=list(DEM=paste("DEM", i, ".sgrd", sep=""), DIRECTION=paste("FlowDirection", i, ".sgrd", sep=""), SEGMENTS=paste("Segments", i, ".shp", sep=""), BASIN=paste("Basin", i, ".sgrd", sep=""), BASINS="basians.shp"), show.output.on.console=TRUE)

I get this error:

error: could not find module: shapes_grid

Any idea how to solve this. Thanks!

Vis
  • 299
  • 1
  • 6
  • 16

2 Answers2

0

The most likely reason is that RSAGA doesn't know where SAGA is installed.

Please include more detail, such as what system you have SAGA installed on, and what path it is installed to.

Use

rsaga.get.libraries()

to see if any libraries are visible.

Brent
  • 131
  • 1
  • 3
0

I don´t know if you setup SAGA install and workspace directory so, try this:

workspace

dir.work <- "your Workspace directory"

SAGA GIS 2.1 install Directory (higher versions don´t work)

dir.saga <- "your SAGA directory"

Setup RSAGA

home <- rsaga.env(workspace=dir.work, path=dir.saga)

repeat your code but assign in env the home variable

rsaga.geoprocessor(lib="ta_channels", module=5,env=home, param=list(DEM=paste("DEM", i, ".sgrd", sep=""), DIRECTION=paste("FlowDirection", i, ".sgrd", sep=""), SEGMENTS=paste("Segments", i, ".shp", sep=""), BASIN=paste("Basin", i, ".sgrd",, sep=""), BASINS="basians.shp"), show.output.on.console=TRUE)

Community
  • 1
  • 1
Fabián
  • 1
  • 3