Hi I encountered that problem and got in contact with the RSAGA 
maintainer about this problem. He suggested the following (temporary) 
solutions, which works for me:

rsaga.geoprocessor("grid_calculus", 1, list(INPUT="dem.sgrd;brillo.sgrd", 
RESULT="out2", FORMUL="a/b"),beep.off = FALSE)

In other words, include the beep.off argument, but set it to FALSE 
(defaults to TRUE). Hope this helps, Paulo Message: 8 Date: Mon, 4 Feb 
2008 13:05:41 -0500 From: Al? Santacruz <[EMAIL PROTECTED]> Subject: 
Re: [R-sig-Geo] FYI: Merging GIS and statistics --- RSAGA To: Tomislav 
Hengl <[EMAIL PROTECTED]>, <[email protected]> Message-ID: 
<[EMAIL PROTECTED]> Content-Type: text/plain 
Hi, I am trying to use the Grid Calculator in SAGA, through RSAGA but I 
have problems with the parameter FORMUL, I can´t get the function "a/b" 
works, the functions "a+b", or "a-b", or "a*b" works, but "a/b" does 
not, Any help is appreciated, see the code below for the errors 
reported, thanks, Ali Santacruz M.Sc. Geomatics. National University of 
Colombia, Bogota, Colombia E-mail: [EMAIL PROTECTED]

------------------------------

Message: 9
Date: Mon, 4 Feb 2008 19:29:37 +0100 (CET)
From: Roger Bivand <[EMAIL PROTECTED]>
Subject: Re: [R-sig-Geo] FYI: Merging GIS and statistics --- RSAGA
To: Al? Santacruz <[EMAIL PROTECTED]>
Cc: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

On Mon, 4 Feb 2008, Al? Santacruz wrote:


> >
> >
> > Hi,
> >
> > I am trying to use the Grid Calculator in SAGA, through RSAGA but I have 
> > problems with the parameter FORMUL,
> >
> > I can?t get the function "a/b" works,
> >
> > the functions "a+b", or "a-b", or "a*b" works, but "a/b" does not,
> >
> > Any help is appreciated,
> >
> > see the code below for the errors reported,
> >
> > thanks,
> >
> > Ali Santacruz
> > M.Sc. Geomatics.
> > National University of Colombia,
> > Bogota, Colombia
> > E-mail: [EMAIL PROTECTED]
> >
> >
> > ## this formula does not work:
>   
>> >> rsaga.geoprocessor("grid_calculus", 1, 
>> >> list(INPUT="dem.sgrd;brillo.sgrd", RESULT="out2", 
>> >> FORMUL="a/b"))
>> >> C:\Users\geomatica\Desktop
>> >> C:\Users\geomatica\Documents\R\win-library\2.6\RSAGA\saga_vc\saga_cmd.exe
>> >> grid_calculus 1 -silent -INPUT dem.sgrd;brillo.sgrd -RESULT out2 
>> >> -FORMUL a\b
>>     
           ^^^^

A very smokey smoking gun, isn't it? The interface is converting all 
forward slash to backslash (Windows *does* respect forward slash in file 
path names, so this isn't strictly needed), so you'll have to try to 
escape the value until you see a/b coming through. I'm in doubt whether 
you'll have any luck, though:

...
     if (beep.off & .Platform$OS.type=="windows") {
         command = gsub("/","\\",command,fixed=TRUE)
                        ^^^^^^^^
         batch = c("net stop beep",command)
         batchfilename = paste(tempfile(),".bat",sep="")
         batchfile = file(batchfilename,"wt")
         writeLines(batch,con=batchfile)
         close(batchfile)
         command = batchfilename
     }
...

in R/RSAGA-core.R, which converts everything whether a file path or not.

Roger

PS. Is the RSAGA maintainer subscribed to this list?



> >

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to