[GRASS-dev] G7: r.neighbors changes data type from CELL to DCELL

Glynn Clements glynn at gclements.plus.com
Tue May 20 05:20:06 PDT 2014


Blumentrath, Stefan wrote:

> >r60346 implements the following logic:
> 
> >For any aggregate, there are 2 factors affecting the output type:
> 
> >1. Whether the input map is integer or floating-point.
> >2. Whether the weighted or unweighted version of the aggregate is used.
> 
> Out of curiosity, could this logic also be applied to r.resamp.stats?
> Or did this module already receive a similar solution?

r.resamp.stats always generates DCELL output.

In theory, the same logic could be used for anything which uses
lib/stats, i.e. r.neighbors, r.resamp.stats, r.series,
r.series.interp, r3.neighbors, and v.vect.stats.

Some of those only use the unweighted methods, in which case the logic
would be simpler.

v.vect.stats has the output type dictated by the type of the output
column. However, each method has a flag to indicate whether conversion
to integer should use truncation or rounding. Rounding is used for
methods which can return non-integer results for integer data.

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


More information about the grass-dev mailing list