[R-sig-Geo] Problem in RSAGA for computing soil wetness index

Alexander Brenning alexander.brenning at uwaterloo.ca
Sat Nov 16 13:41:15 CET 2013


Hi Barry,

the in.dem argument to rsaga.wetness.index should a file name (with default file extension .sgrd) in SAGA grid format. I.e. you do not import the raster data into R to perform this task, this operation is entirely file-based. See e.g. example section of the function's help page:

rsaga.wetness.index("dem.sgrd","swi.sgrd")

Cheers
  Alex

--
Alexander Brenning
brenning at uwaterloo.ca - T +1-519-888-4567 ext 35783
Department of Geography and Environmental Management
University of Waterloo
200 University Ave. W - Waterloo, ON - Canada N2L 3G1
UW: https://uwaterloo.ca/gem/people-profiles/alexander-brenning
Academia.edu: http://uwaterloo.academia.edu/AlexanderBrenning
LinkedIn: http://ca.linkedin.com/pub/alexander-brenning/3/242/440




Date: Fri, 15 Nov 2013 15:34:13 +0000
From: "Rawlins, Barry G." <bgr at bgs.ac.uk>
To: "'r-sig-geo at r-project.org'" <r-sig-geo at r-project.org>
Subject: [R-sig-Geo] Problem in RSAGA for computing soil wetness index
Message-ID:
        <C1D2C279E163C549802E18252065A441053CD02352 at nerckwmbc.ad.nerc.ac.uk>
Content-Type: text/plain; charset="us-ascii"

I have been trying to use RSAGA to compute SWI as per various instructions on implementing RSAGA.

I have installed SAGA and I can successfully run the rsaga.env() call and the other R spatial packages.

I imported a SAGA grid of elevations:

summary(sgrd)
     Length Class  Mode
header     8  -none- list
data   98400  -none- numeric

and I can see elevation data if I summarise the data in the grid.

When I try to run the call to the wetness index:

>rsaga.wetness.index(in.dem=sgrd,out.wetness.index="SWI.grd")

I get:

Error in system(command, intern = intern, show.output.on.console = show.output.on.console,  :
  'CreateProcess' failed to run 'C:\Users\bgr\DOCUME~1\R\WIN-LI~1\3.0\RSAGA\SAGA-GIS\saga_cmd.exe ta_hydrology "SAGA Wetness Index" -DEM "list(ncols = 410, nrows = 240, xllcorner = 277000, yllcorner = 322000, cellsize = 200, nodata_value = -9999, xllcenter = 277100, yllcenter = 322100).sgrd" -C "NA" -GN "NA" -CS "NA" -SB "NA" -DEM "NA" -C "NA" -GN "NA" -CS "NA" -SB "NA" -DEM "NA" -C "NA" -GN "NA" -CS "NA" -SB "NA" -DEM "NA" -C "NA" -GN "NA" -CS "NA" -SB "NA" -DEM "NA" -C "NA" -GN "NA" -CS "NA" -S

Does anyone recognise this error and how I might solve it?

My sessionInfo below:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

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

other attached packages:
[1] maptools_0.8-27 rgdal_0.8-11    sp_1.0-14       RSAGA_0.93-6
[5] plyr_1.8        shapefiles_0.7  foreign_0.8-55  gstat_1.0-17
[9] ctv_0.7-8

loaded via a namespace (and not attached):
[1] grid_3.0.1       intervals_0.14.0 lattice_0.20-15
[4] MASS_7.3-26      spacetime_1.0-9  tools_3.0.1
[7] xts_0.9-7        zoo_1.7-10

Thanks, Barry

This message (and any attachments) is for the recipient ...{{dropped:2}}



More information about the R-sig-Geo mailing list