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

Glynn Clements glynn.clements at virgin.net
Fri Nov 9 09:15:33 EST 2001


Glynn Clements 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".

As Frank pointed out (a while back), this is actually correct; it
ensures that:

a) the reported percentages are correct (G_percent() is called at the
end of each pass), and

b) the final call to G_percent() reports 100% and prints a newline.

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



More information about the grass-dev mailing list