Does the r.mapcalc man page and tutorial assume that one has the name
of an input map layer in some other part of the equation and thus
never mentions what happens if you don't, but still want to use x(),
y()?
Is this what one would be forced to do in that case?
(e.g. when making a layer with values being the distance from home:)
out=nantou.dist xc=235577 yc=2675353 ;\
r.mapcalc "${out?} = nantou - nantou + sqrt((x() - ${xc?})^2 + (y() - ${yc?})^2)"
[nantou - nantou: a noop just to get the layer nantou involved in the
expression.]
So: please update the docs to mention what to do.
--
http://jidanni.org/ Taiwan(04)25854780
Dan Jacobson wrote:
Does the r.mapcalc man page and tutorial assume that one has the name
of an input map layer in some other part of the equation and thus
never mentions what happens if you don't, but still want to use x(),
y()?
Is this what one would be forced to do in that case?
(e.g. when making a layer with values being the distance from home:)
out=nantou.dist xc=235577 yc=2675353 ;\
r.mapcalc "${out?} = nantou - nantou + sqrt((x() - ${xc?})^2 + (y() - ${yc?})^2)"
[nantou - nantou: a noop just to get the layer nantou involved in the
expression.]
Why would you want to involve a map which wasn't actually used?
Note that the following will work:
r.mapcalc "${out?} = sqrt((x() - ${xc?})^2 + (y() - ${yc?})^2)"
--
Glynn Clements <glynn.clements@virgin.net>
"G" == Glynn Clements <glynn.clements@virgin.net> writes:
G> Dan Jacobson wrote:
Does the r.mapcalc man page and tutorial assume that one has the name
of an input map layer in some other part of the equation and thus
never mentions what happens if you don't, but still want to use x(),
y()?
Is this what one would be forced to do in that case?
(e.g. when making a layer with values being the distance from home:)
out=nantou.dist xc=235577 yc=2675353 ;\
r.mapcalc "${out?} = nantou - nantou + sqrt((x() - ${xc?})^2 + (y() - ${yc?})^2)"
[nantou - nantou: a noop just to get the layer nantou involved in the
expression.]
G> Why would you want to involve a map which wasn't actually used?
G> Note that the following will work:
G> r.mapcalc "${out?} = sqrt((x() - ${xc?})^2 + (y() - ${yc?})^2)"
OK, and indeed it does.
Well, it's not my fault that I didn't know that: the r.mapcalc man
page goes on and on about "raster map layers", never hinting that what
it really does is just march thru each cell[?] in the current region,
independently of any raster map, making calculations at each cell...
Maybe the man page should mention something like this near the top.
BTW: I see an "&"'s there instead of & , e.g.:
Some characters have special meaning to the
UNIX shell. These include, among others:
* ( ) > & |
Also:
BUGS
Continuation lines must end with a and have NO trailing
End with a what? Can't tell from the manpage [5.0pre1].
--
http://jidanni.org/ Taiwan(04)25854780
Dan Jacobson wrote:
BTW: I see an "&"'s there instead of & , e.g.:
Some characters have special meaning to the
UNIX shell. These include, among others:
* ( ) > & |
This was fixed in later versions. The manpages are generated from the
HTML files using the g.html2man; earlier versions didn't substitute
all of the HTML entities.
Also:
BUGS
Continuation lines must end with a and have NO trailing
End with a what? Can't tell from the manpage [5.0pre1].
There should be a backslash ("\") there.
However, this flaw is still present in the current version. The script
inserts a literal backslash into the manpage source, but backslashes
are interpreted by troff. The script should convert a backslash to
"\e"; hopefully someone who understands perl will look into it.
--
Glynn Clements <glynn.clements@virgin.net>