[GRASS5] [bug #802] (grass) r.in.gdal: number of imported rows incorrect?

Glynn Clements glynn.clements at virgin.net
Thu Sep 20 10:14:47 EDT 2001


Request Tracker wrote:

> it seems that r.in.gdal uses an unusual row index
> (src/raster/r.in.gdal/main.c):
> 
> for (row = 1; row <= nrows; row++)
>     {
> 
> Usually the row number starts with 0.

This isn't limited to r.in.gdal; there is other code in GRASS which
uses the Pascal convention for array indices (e.g. i.cca).

In the case of the above file, this means that the call to G_percent()
is wrong; the other references to "row" are as "row-1".

r.in.gdal is trivial to fix, as the issue is limited to this loop. I
didn't touch i.cca, as the one-based convention is used throughout.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list