[R-sig-Geo] R-sig-Geo Digest, Vol 115, Issue 22

Alexander Brenning alexander.brenning at uwaterloo.ca
Fri Mar 22 14:33:58 CET 2013


Hi Ludwig,

rsaga.env doesn't save anything in a global variable like the R function options does; it simply creates a list with verified settings. See e.g. Example code in the rsaga.env help file.

Here an example for Windows, using your folder name:

library(RSAGA)

# SAGA GIS binaries in C:/Pr....._32bit,
# modules by default in the 'modules' subfolder of 'path':
myenv <- rsaga.env(path = "C:/Program Files (x86)/SAGA-GIS_2.0.8_32bit")
myenv # have a look at the contents

# now call a modules using these customized RSAGA settings:
# note the env = myenv argument:
rsaga.hillshade("dem","hillshade",env=myenv)
# 'dem.sgrd' must be in myenv$workspace, SAGA GIS in myenv$path, etc.

I hope this helps
  Alex

Date: Fri, 22 Mar 2013 01:23:57 -0700 (PDT)
From: Ludwig Hilger <l.hilger at ku.de>
To: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] RSAGA and a custom module
Message-ID: <1363940637782-7583126.post at n2.nabble.com>
Content-Type: text/plain; charset=UTF-8

Der Mr. Brenning,

thank you for the fast reply! Yes, when specifiying the path attributes, I
can find the module. This brings me to a reated issue. I have three SAGA
versions on the computer (because of I do not know how to compile the custom
module for 64 bit). If I connect to 2.0.8 32 bit by:

rsaga.env(path = "C:/Program Files (x86)/SAGA-GIS_2.0.8_32bit", modules =
"C:/Program Files (x86)/SAGA-GIS_2.0.8_32bit/modules")

I get the correct response, but R does not seem to store this connection, if
I enter rsaga.env() in the next line I get the connection to my SAGA 2.1.0
64 bit. As I result, I need to specify the env parameter in every call to
rsaga.geprocessor() if I want to use the 2.0.8 32 bit version (from which
the module was compiled). It is not a great problem, but do you know why
that could be?

Once again, thank you very much!
Ludwig



-----
Dipl. Geogr. Ludwig Hilger
Wiss. MA
Lehrstuhl f?r Physische Geographie
Katholische Universit?t Eichst?tt-Ingolstadt
Ostenstra?e 18
85072 Eichst?tt

Tel.: 08421-93-1180
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/RSAGA-and-a-custom-module-tp7583108p7583126.html
Sent from the R-sig-geo mailing list archive at Nabble.com.




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