Hi Glynn,
That is good to know. I started using that form because I would always
get confused with ' and so I though that using the echo command
would be safer. But now that I know better, my scripts will be simpler
Daniel
On Fri, Mar 6, 2009 at 1:41 AM, Glynn Clements gl...@gclements.plus.com
Nikos:
Try this:
r.mapcalc river=if(river==$old, $new, null())
Glynn:
Note that this won't work in 7.0, where r.mapcalc uses the parser. It
will complain that r.mapcalc doesn't have a river=... option.
For portability, always:
1. quote the entire expression, and
2. insert a space
Nikos Alexandris wrote:
Nikos:
Try this:
r.mapcalc river=if(river==$old, $new, null())
Glynn:
Note that this won't work in 7.0, where r.mapcalc uses the parser. It
will complain that r.mapcalc doesn't have a river=... option.
For portability, always:
1. quote the entire
In general, it's preferable to do as much as possible in each
r.mapcalc command. E.g. rather than:
r.mapcalc $GIS_OPT_OUTPUT.r = r#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT +
(1.0 - .$GIS_OPT_PERCENT) * r#$GIS_OPT_SECOND
r.mapcalc $GIS_OPT_OUTPUT.g = g#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT
Hi,
did someone tried -like me- to use r.mapcalc in a script inside an
do-while-clause?
I cannot pass changing variables $old, $new like:
r.mapcalc 'river=if(river=$old,$new,null())'
its because of the '', which are needed because if the if-statement.
I failed passing the hole statement eg.
Try this:
r.mapcalc river=if(river==$old, $new, null())
Cheers, Nikos
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Its awful!
That does work (in tsch so far!
I tried -not alone- for hours...
Thank you very much, Nikos!
Maybe you know a way to make r.mapcalc quiet?
Or maybe to query a rastermap col-row wise?
Greetings from Potsdam at the moment.
achim
Nikos Alexandris schrieb:
Try this:
r.mapcalc
Hallo Achim!
On Thu, 2009-03-05 at 15:55 +0100, achim wrote:
Its awful!
That does work (in tsch so far!
What is _tsch_? Do you mean _tcsh_? Sorry for my ignorance if it's
something I _should_ know :-)
Maybe you know a way to make r.mapcalc quiet?
Not really. The Experts should know that
The Problem isn't solved yet!!
I posted an easy example, but calculating with more complicated
scenarios I got these:
r.mapcalc river=if(river[0,1]=4032076 ,4032075,river)
syntax error, unexpected '=', expecting ')'
Parse error
or
r.mapcalc river=if( river=4032076 ||| river=4032076
On Thu, Mar 5, 2009 at 3:42 PM, achim a...@jupiter.uni-freiburg.de wrote:
Hi,
did someone tried -like me- to use r.mapcalc in a script inside an
do-while-clause?
I cannot pass changing variables $old, $new like:
r.mapcalc 'river=if(river=$old,$new,null())'
its because of the '', which are
Nikos Alexandris wrote:
Try this:
r.mapcalc river=if(river==$old, $new, null())
Note that this won't work in 7.0, where r.mapcalc uses the parser. It
will complain that r.mapcalc doesn't have a river=... option.
For portability, always:
1. quote the entire expression, and
2. insert a space
Daniel Victoria wrote:
To get around the ' or problems when scripting for r.mapcalc I
prefer to use another syntax construction that goes like this:
echo river = if(river == $old, $new, null()) | r.mapcalc
That way you evaluate the variables $old and $new before sending it to
12 matches
Mail list logo