[GRASS5] Severe internal bugs in raster format

Dear developers,

sorry for bad news: but it seems there is a lot
of confusion in raster format read/write in several
modules:

Example:
d.rast a_raster_map
d.rast.zoom # we want to look at some pixels only
d.rast.num # show cell values
d.what.rast # query with mouse: result is different
r.out.ascii # result is different as well

(from A. Lobo:)
r.stats: some inconsistent results comparing to r.average
*First, I compute the per-class averages:
    r.average base=medv cover=test out=borra.me
*Second, I check the result for, i.e., class 23:
    d.what.rast map=medv,borra.me
    2676500(E) 4409500(N)
          medv in user1 (23)S_SUPRAMEDITERRANEAN_ZONE
          borra.me in user1, quant (111)
          borra.me in user1, actual (110.794075)
*Third, I compute the statistics for each class, but the results are not
the same as given by d.what.rast. For example, for class 23:
    r.stats -c in=medv,borra.me
    r.stats: 100%
      ...
      23 110.299171-110.744906 6082
      ...
*While d.what.rast was giving 110.794075.

Was this the ONLY line containing 23 for medv - there
should have been another one or more following it probably with
another quantized range.

We should check this quickly, otherwise we cannot trust any result.
I guess the problem is due to ".5" (half raster cell) addition
for query any some potential mixture of
- save values at cell center
- save values at cell corner (which is wrong as far as I know but correct
                               for ESRI).

Yes, the + 0.5 is correct in order to get the center of the cell.
There could also be a problem in the quant routines, or just
some confusion about what r.stats reports.

Another bug: r.in.arc reads in ARC/INFO grid files reversed.
ESRI saves from lower left to upper right, GRASS from
upper left to lower right. The module does not (yet) take
care of this. I would be able to fix in GRASS 4.x but in GRASS 5
the row number cannot be specified any more (G_put_raster_c_row()).
So we have to flip the input file or something else... How to do this?

I've been using r.in.arc for weeks with no problems.

- Bill

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 3147
max: 0