[GRASS-user] mfilter

Glynn Clements glynn at gclements.plus.com
Tue Mar 20 10:16:53 EDT 2007


Jaros-Bław Jasiewicz wrote:-A

> > I do wonder if mfilter can perfom filtering on float raster, ie
> > providing results as raster. My recent use of r.mfilter led me to
> > the contrary (i.e output is integer also input was raster). I am
> > wrong somewhere?
> 
> well, not
> The only solution is to multipy orginal map before filtering, and divide 
> it after
> 
> but... it is possible to change the r.mfilter to output fp maps? Is I 
> read source code the results is fp and next is rounded to near integer.  
> Maybe removing this part will be enough (but I'm not sure, I'm not 
> skilled enough in grass programming)

There isn't any fundamental reason why r.mfilter cannot be changed to
create FP maps.

Apart from allocating FCELL/DCELL buffers, certain functions need to
be changed, e.g.:

	G_open_cell_new -> G_open_fp_cell_new
	G_get_map_row -> G_get_d_raster_row

Also, the code would need to check for and handle null values; the old
G_get_map_row() interface silently converts nulls to zeroes.

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




More information about the grass-user mailing list