[GRASS-user] Re: Values from multiple raster -

Glynn Clements glynn at gclements.plus.com
Tue Nov 23 14:34:24 EST 2010


Gabriele N. wrote:

> I have a new problem, this time I would like to concatenate two maps A and B.
> A is with 8 digits, B is with 4 digits. So I do as usual:
> 
> r.mapcalc "output" = "((" A "* 10000) (" B "))"
> 
> But I get strange values with negative values. I did several tests but
> without resolve. Perhaps r.mapcalc may have problems with numbers greater
> than 10 digits

CELL maps contain signed, 32-bit values using sign-bit representation,
so the range is -2147483647 to 2147483647 inclusive (i.e. -(2^31-1) to
2^31-1). So you aren't going to be able to store 12-digit numbers in a
CELL map.

DCELL maps use the C "double" type, which on most systems is IEEE-754
double precision, which has a 53-bit mantissa, plus a separate sign
bit. That can exactly represent any integer between -9007199254740992
and 9007199254740992 inclusive (i.e. almost 16 decimal digits).

However, depending upon what you want to do with the result, this may
not be an option, as not all modules can work with floating-point
data.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list