'bugfix' for s.surf.idw

Job Spijker spijker at geo.uu.nl
Thu Oct 28 09:40:39 EDT 1999


Hi

I was hoping that the bugs in s.surf.idw where fixed in the beta4 release
but I noticed that this was not the case. So I did some quick and dirty
patching to the source and now it works fine (with me ;-). The problem
was that s.surf.idw stil uses integers to store interpolated numbers
which, in my case, should be doubles (floating point numbers). (or to be
more precisely it uses a type CELL instead of a type DCELL, the last is
more appropriate to my opinion)  

I changed the file main.c in the src/sites/s.surf.idw/cmd directory which
now does a correct (although I didn't do any validation yet) interpolation
and and  the result is a raster map consisting of floating numbers as
z-values instead of integers.

The changes I've made (line numbers are aproximate and I'm sorry I
didn't use diff):
-- created new variable of type DCELL on line 22
DCELL *dcell
-- allocated memory for dcell on line 96
dcell=G_allocate_d_raster_buf()
-- created a file pointer to rasterfile wich uses floats on line 108
fd=G_open_raster_new(parm.output->answer,2);
-- changed line 193 into this (replaced 'cell' with 'dcell')
dcell[col] = (DCELL) (sum1/sum2 + .5);
-- changed routine to write data to fd on line 197 into
G_put_d_raster_row(fd,dcell)

Those who are interested can receive the main.c file by mail, just send me
a message.

Greetings
	Job 

----------------------------------------------------------------------
Job Spijker                                       
Faculty of Earth Sciences/ Department of Geochemistry
Utrecht University, The Netherlands
Budapestlaan 4 3584 CD Utrecht                    
T: 030-253 3264 F: 030-253 5030       
----------------------------------------------------------------------



More information about the grass-user mailing list