[GRASS-dev] r.median (non)functionality
Glynn Clements
glynn at gclements.plus.com
Sun Jul 15 11:11:40 EDT 2007
Markus Neteler wrote:
> Trying out r.median, I discovered
>
> GRASS 6.3.cvs (spearfish60):~/ > r.median base=fields cover=soils.Kfactor
> output=K.by.farm.median --o
> 100%
> ERROR: Reading r.stats output
>
> I compared to r.mode: this fix seems to be necessary:
>
> --- main.c 15 Jul 2007 12:30:37 -0000 2.9
> +++ main.c 15 Jul 2007 12:48:43 -0000
> @@ -79,7 +79,7 @@
> if (G_read_cats (covermap, cover_mapset, &cover_cats) < 0)
> G_fatal_error (_("Cannot read category labels of raster map <%s>"), covermap);
>
> - strcpy (command, "r.stats -a \"");
> + strcpy (command, "r.stats -an \"");
> strcat (command, G_fully_qualified_name (basemap, base_mapset));
> strcat (command, ",");
> strcat (command, G_fully_qualified_name (covermap, cover_mapset));
Presumably r.median fails if you have any null cells?
> Should I submit?
Yes.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list