[R-sig-Geo] RSAGA catchment area (flow tracing) with AsterGDEM

Alexander Brenning alexander.brenning at uwaterloo.ca
Wed Mar 20 15:13:23 CET 2013


Hi Oscar,

it works on my computer with argument name ELEVATION instead of DEM as shown in the SAGA GIS usage information.

library(RSAGA)
setwd("C:/TEMP")
workenv = rsaga.env()
rsaga.geoprocessor(lib="ta_hydrology",module=2,env=workenv,param=list(ELEVATION="dem.sgrd",CAREA="dem_catchmentarea",CSLOPE="dem_catchmentslope",STEP=1,Method=0,MINDQV=0.0,CORRECT=FALSE))

Always check rsaga.get.usage when having trouble using SAGA GIS arguments:

rsaga.get.usage("ta_hydrology",2)

Cheers
  Alex



Date: Tue, 19 Mar 2013 14:39:18 +0100
From: Rainer Hurling <rhurlin at gwdg.de>
To: "N. Anselm" <n.anselm at fu-berlin.de>
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] RSAGA catchment area (flow tracing) with
        AsterGDEM
Message-ID: <51486A86.9050106 at gwdg.de>
Content-Type: text/plain; charset=ISO-8859-1

Am 19.03.2013 12:14 (UTC+1) schrieb N. Anselm:
> dear list,
>
> I use R for scripting in saga gis. Mostly it works fine, but I dont know
> why the catchment area (flow tracing) does not work with the ASTER
> scene. In saga it works,
> so it should be something in my 'code'. I tried METHOD as well as Method
> (there seems to be inconsistency in saga), I tried CORRECT=FALSE,False,0
> and not,
> none of it worked, possibly it's something completely different.
>
> Maybe someone of you can give advice?
> thank you very much,
>
> n. anselm
>
>
> workenv<-rsaga.env(workspace=".",path="/usr/bin",modules="/usr/lib/saga")
>
> rsaga.geoprocessor(lib="ta_hydrology",module=2,env=workenv,param=list(DEM="aster_nosink.sgrd",CAREA="aster_catchmentarea",CSLOPE="aster_catchmentslope",STEP=1,Method=0,MINDQV=0.0,CORRECT=FALSE))

Hmm, it seems that your DEM= should be changed into ELEVATION=

But I may be wrong because I am working with the upcoming version 2.1.0
on FreeBSD with R-devel and RSAGA-0.93-2.

HTH,
Rainer


>> sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: i686-pc-linux-gnu (32-bit)
>
> locale:
>  [1] LC_CTYPE=de_DE.UTF-8          LC_NUMERIC=C
>  [3] LC_TIME=de_DE.UTF-8           LC_COLLATE=de_DE.UTF-8
>  [5] LC_MONETARY=de_DE.UTF-8       LC_MESSAGES=de_DE.UTF-8
>  [7] LC_PAPER=de_DE.UTF-8          LC_NAME=de_DE.UTF-8
>  [9] LC_ADDRESS=de_DE.UTF-8        LC_TELEPHONE=de_DE.UTF-8
> [11] LC_MEASUREMENT=de_DE.UTF-8    LC_IDENTIFICATION=de_DE.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] raster_2.0-41  RSAGA_0.93-2   plyr_1.8       shapefiles_0.7
> foreign_0.8-48
> [6] gstat_1.0-16   sp_1.0-5       rkward_0.5.6
>
> loaded via a namespace (and not attached):
> [1] grid_2.14.1      intervals_0.13.3 lattice_0.20-0   spacetime_1.0-4
> [5] tools_2.14.1     xts_0.9-3        zoo_1.7-9

--
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



More information about the R-sig-Geo mailing list