[GRASS-user] Problem with r. mapcalc

Giuseppe Amatulli giuseppe.amatulli at gmail.com
Wed Feb 24 19:55:34 PST 2021


Dear all
I have some strange behaviour in r.mapcalc that i can not figure out the
reason.
I have a Float32 raster with very large pixels values
wget
https://www.dropbox.com/s/pxh473rs34wvxuc/basin_lbasin_172_oft_crop.tif?dl=0
min                      max
241981407232    3266766176256
I want rescale to in such a way that  the min is reachin 1 and the maximum
value is - min
Therfore
min=241981407231.0
r.mapcalc  " output  =   float( float(input)   - $min  ) "
and i get

min max output
1  3024784719872
which rather should be
3266766176256 - 241981407231 = 3024784769025

It seems to me that the subtraction is working fine for small numbers but
not for larger numbers.
I tried all the combinations of
r.mapcalc  " output  =   float( float(input)   - $min  ) "
r.mapcalc  " output  =   float( input   - $min  ) "
Attached the script.
Did I reach some numerical limitation?
Any suggestions?
Thanks giuseppe



-- 
Giuseppe Amatulli, Ph.D.

Research scientist at
School of the Environment
Yale University
New Haven, CT, USA - 06511
Tweeter: @BigDataEcology
Teaching: http://spatial-ecology.net
Work:  https://environment.yale.edu/profile/giuseppe-amatulli/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210224/664f6312/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sc39_lbasin_basin_uniq_CompUnit_test.sh
Type: application/x-shellscript
Size: 2523 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210224/664f6312/attachment.bin>


More information about the grass-user mailing list