[GRASS5] 0 != no data

Justin Hickey jhickey at hpcc.nectec.or.th
Mon Jun 11 07:41:54 EDT 2001


Hi Glynn and everyone else

Glynn Clements wrote:
> Until recently, the most likely reason would have been the use of
> G_put_map_row(), which treats zero as null unless G_zeros_r_nulls(0)
> is called first.
> 
> However, Markus recently replaced all of uses of this function with
> G_put_raster_row() (or similar), which doesn't treat zero as null.
> 
> There is one reference to G_put_map_row_random() in
> src/imagery/i.ortho.photo/photo.rectify/write.c; this function also
> uses the zeros_r_nulls setting. Are you using i.ortho.photo?
> 
> Apart from that, something would have to be explicitly setting zero
> cells to null using G__put_null_value_row() (or even lower level
> functions).

I looked into this further and it appears that the original map was
imported using Grass 4.3 and then copied to a Grass 5 database.
Obviously there would not be a null file in this case. If the file is
imported using r.in.tiff in Grass5, the null file is automatically
created. What threw me was that the first time I ran d.rast, the file
displayed normally. The second time it was run, the null values
appeared. As mentioned in my previous post, the solution is to run
r.support to create a null file. Thus, I no longer think that this is a
show stopper.

However, I would still propose that we eliminate this null file and
never treat 0 as "no data". It has been pointed out that this was
originally implemented for Grass 4.x users who still wanted 0 to mean
"no data" in Grass 5. But with a simple r.mapcalc command, these users
can transform the 0 data to proper NULL values. Thus, there is no need
for the null file.

So, if there are no objections, I will post a proposal to the Grasslist
mailing list to eliminate the null file. If that meets with a positive
response, I will add this to the TODO file.

By the way, I think we should change the output of d.what.rast for 5.0,
since regardless of whether 0 is interpreted as "no data" or not, the
program lists it as no data. If there are no objections I'll make this
change.

Thank you to those who made suggestions, it helped me track this thing
down.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================



More information about the grass-dev mailing list