<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000099">
On 05/20/2013 01:46 PM, Glynn Clements wrote:<br>
<blockquote
cite="mid:20890.3374.19514.131548@cerise.gclements.plus.com"
type="cite">
<pre wrap="">
Markus Metz wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so the idea doesn't get lost?
</pre>
</blockquote>
<pre wrap="">
Instead of
r.mapcalc "A = if(B==0,
(round(C/0.0001)-1175699902)/(3007966667-1175699902) *100.0, 1)"
--overwrite
try
r.mapcalc "A = if(B==0,
(round(C/0.0001)-1175699902.0)/(3007966667.0-1175699902.0) *100.0, 1)"
--overwrite
or better with whitespaces
r.mapcalc "A = if(B == 0, (round(C / 0.0001) - 1175699902.0) /
(3007966667.0 - 1175699902.0) * 100.0, 1)" --overwrite
adding .0 to numbers forces all calculations to be done with floating
point double precision
</pre>
</blockquote>
<pre wrap="">
That won't help; the problem is that round() returns an integer.
It wouldn't be particularly hard to change it so that the return type
is the same as the argument type, but that might break existing
scripts.
</pre>
</blockquote>
Hi Glynn,<br>
<br>
In case you haven't seen it, Markus Metz has implemented in trunk <a
class="changeset"
href="http://trac.osgeo.org/grass/changeset/56313"
title="r.mapcalc: enhance round()">r56313</a> the option to have
the same raster type as output of round() as the input type, see
ticket 1976 (<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/grass/ticket/">http://trac.osgeo.org/grass/ticket/</a>).<br>
<br>
I sure hope it does not brake existing scripts, as this is a very
useful enhancement I think.<br>
<br>
</body>
</html>