[GRASS-user] r.terraflow crashes

Vaclav Petras wenzeslaus at gmail.com
Sun Jan 3 17:52:50 PST 2016


Hi Ken,

On Sun, Jan 3, 2016 at 6:06 PM, Markus Neteler <neteler at osgeo.org> wrote:

> > r.mapcalc 'phi = bed*2' does produce a data file, full resolution or
> downsampled.
> >
> > Oddly, "2*bed" works, but "2.5*bed" does not work.
>
> That's rather unusual, indeed.
>

these expressions work for me:

> r.mapcalc "test = 21"
> r.mapcalc "test_a = 2*test"
> r.mapcalc "test_b = 2.5*test"
> r.mapcalc "test_c = test*2"
> r.mapcalc "test_d = test*2.5"
> r.info test_a | grep "Data Type"
 |   Data Type:    CELL
> r.info test_b | grep "Data Type"
 |   Data Type:    DCELL
> r.info test_c | grep "Data Type"
 |   Data Type:    CELL
> r.info test_d | grep "Data Type"
 |   Data Type:    DCELL

CELL is for integer and DCELL for double (floating point). Spaces around
operators are best practice but nor required and I did not include them to
make it similar to you example.


> > Does r.mapcalc only do integer math?
>
> Definitely yes.
>

I'm not sure what Markus is referring ti but in general, r.mapcalc works
with integers and floating point numbers (floats and doubles) as requested.


>
> > Not according to the manual.
>
> Oh - so we should improve that:
> https://grass.osgeo.org/grass70/manuals/r.mapcalc.html
>
> Please let us know where to add extra explanations (what did you look
> for and didn't find?)


In any case this is true, if you are/were confused about the functionality,
please suggest a change to the manual for benefit of others and yours as
well when you get back to it after some time.

Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160103/5440fff5/attachment.html>


More information about the grass-user mailing list