document what number is NULL [Re: [GRASS-dev] r.mapcal rand() strangeness]

Maciej Sieczka tutey at o2.pl
Thu Mar 13 15:40:51 EDT 2008


Maciej Sieczka pisze:
> Glynn Clements pisze:

>> -2^31 (= 0x80000000 = -2147483648) is the null value
>> for the CELL type, so you'll never see that value in a map.
> 
>> The FP nulls are the all-ones bit patterns. These corresponds to NaN
>> according to the IEEE-754 formats, although it isn't the "default" NaN
>> pattern generated by most architectures (which is usually 7fc00000 or
>> ffc00000 for float and 7ff8000000000000 or fff8000000000000 for
>> double, i.e. an all-ones exponent, the top-bit of the mantissa set,
>> and either sign).
>>
>> So far as arithmetic is concerned, any value with an all-ones exponent
>> and a non-zero mantissa is treated as NaN. But the GRASS
>> G_is_[fd]_null_value() functions only consider the all-ones bit
>> pattern to be null. I intend to change this in 7.x so that all FP NaN
>> values are treated as null. This will mean that code which can
>> generate NaNs doesn't have to explicitly convert them to the GRASS
>> null value.

> These should go to "Raster data processing in GRASS GIS". As I don't 
> really understand the part about floating point, I won't do it myself. 
> Somebody more savvy please do, putting it some simpler words if possible.

I've submitted details about 2d and 3d map types and their data types to 
rasterintro.html. Thanks to everyone who helped me sort it out.

Anybody please extend the notes about NULL along the lines of Glynn's 
words above, in rasterintro.html. Users should be informed what number 
GRASS uses for NULL in raster data, for different data types.

Maciek


More information about the grass-dev mailing list