[GRASS5] very confused over NULL in rasters

Eric G . Miller egm2 at jps.net
Sun Dec 17 17:20:07 EST 2000


On Sun, Dec 17, 2000 at 11:42:45AM -0700, William L. Baker wrote:
> Unfortunately,  I cannot simply use the library functions.
> r.le reads in the whole raster and works with it internally,
> deciding what values constitute a "patch" and then
> tracing the boundaries of it etc.

I still think it's possible.

> Life would be simpler if GRASS had library functions 
> to do all the things that are needed to make r.le work!

Maybe you could outline what those things are.  If they would be
generally useful, we could consider them for library function additions
in 5.1.

> So, I need to know the actual representation of null in
> the raster itself and in the null-value file from bringing it
> in with G_get_null_value_row.

If you read the raster the "normal" way, G_open_cell_old(), the "proper"
NULL value will be embedded in the rows that are subsequently read.  You
can obtain a copy of the NULL value for the raster type using
G_set_null_value(rast, 1, maptype) which you can use for subsequent
comparisons; where rast is a void * to the proper number of bytes for
one cell based on cell type (4,4, or 8 generally).

So, for a CELL map, you get INT_MAX embedded. For FP, you get the
appropriate NaN.

Since I don't know the specifics, of r.le.xxxx, maybe I'm missing
something here as to what you need...

-- 
Eric G. Miller <egm2 at jps.net>

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list