[GRASS-dev] mean value bug?

Glynn Clements glynn at gclements.plus.com
Wed Nov 25 18:51:47 EST 2009


Peng Du wrote:

> Hi, the following part is from code grass-6.4.0RC5/imagery/i.pca/main.c
> 
> static int calc_mu(int *fds, double *mu, int bands)
> {
>     ...
> ...
> }
> 
> Correct me if I'm wrong, but I can't seem to tell how variable ptr is 
> used. This two loops are accumulating values in a certain band and ptr 
> points to the data value:
> 
> sum += G_get_raster_value_d(rowbuf, maptype);
> 
> Shouldn't the first parameter of G_get_raster_value_d be ptr rather than 
> rowbuf?

Yes. And likewise for G_is_null_value().

Fixed in r39800 (6.5) and r39801 (7.0).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list