[GRASS5] 0 != no data

Helena Mitasova hmitaso at unity.ncsu.edu
Mon Jun 11 11:03:18 EDT 2001


Justin

as I understand it, this issue has already been resolved (I believe I was
wrong in my
answer when I thought that it was not). The null file should stay - that
is
the file which ensures that NULL is different from 0. What had to be
changed
was reading of files which did not have NULL file - originally, 0 was
treated as NULL
for such files. As I understand it (correct me if I am wrong) this was
changed
to read 0 as a 0-value if NULL file is missing . When NULL file is there,
there is no
problem, the only issue were old files which did not have NULL-file, which
was your case.
With NULL file present 0 should not be treated as NULL unless you define
it as such.

Helena

Hickey wrote:

> 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!!!
> ==================================================================
> _______________________________________________
> grass5 mailing list
> grass5 at geog.uni-hannover.de
> http://www.geog.uni-hannover.de/mailman/listinfo/grass5




More information about the grass-dev mailing list