[GRASSLIST:5301] Re: Understanding s.surf.idw

Paul Kelly paul-grass at stjohnspoint.co.uk
Sun Jan 12 07:31:32 EST 2003


As far as I understand it the s.surf.idw algorithm is very simple:
1. it loops through every cell in 'output', row by row
and column by column
2. For each cell, it loops through every site in 'input', and calculates
the distance of this site from the current cell
3. It takes the 'npoints' nearest sites and calculates the mean of the
'field'th floating point attributes in each site
4. This mean is written to the current cell in 'output'

Notes:
'output' is a raster layer and 'input' is a sites layer.

The size and resolution of 'output' is determined by the current region

For every cell in 'output', the distance to every site in 'input' is
calculated to find the nearest ones (no segmentation is performed like in
s.surf.rst). This makes it very slow if you have a lot of sites.

Sites files can have more than one floating point attribute. This is the
reason for the 'field' option. But if you have a simple sites file with
only one floating point attribute, e.g. elevation, there is no need to
change from the default of 1. It is nothing to do with precision.

As implied above, 'npoints' is the number of points that are averaged to give
the mean value for the output cell. By default it uses the 12 nearest points.
Theoretically the data might be smoothed less if you use a lower value for
npoints. And if you don't have as many as 12 points in your input file I
suppose you'd have to use a lower value.

>From my experience, for continuous or smoothly varying data s.surf.rst
usually gives better results than s.surf.idw.

Paul

On Sat, 11 Jan 2003, Antonio wrote:

>
> Hi.
>
> I'm trying to figure out how s.surf.idw works. From my understanding, it
> is suppose to do interpolation of point data using site files. However
> there are a few things I havn't got. I want to use the program for
> prepareing rainfall data. I have 5 pluviometers and using the s.surf.idw
> for calculating theissen polygons is not giving me satifaction as the
> region I'm studing is mountainous. So I'd like to distribute the data
> better. The two options I have to give to s.surf.idw are misteriuos to
> me :-)
>
> The npoints option means "if you only have 5 point then give
> npoints=5??". Am I correct?
> And the other option relative to the decimals? What's that for? Is it to
> tell the program that it has to consider only (1 is the default) 1
> decimal place for the site values?
>
> Thanks.
>
>




More information about the grass-user mailing list