Hello everyone. In these days I was using IDW to make an easy interpolation of a point features layer, and I faced a strange behaviour.
My dataset is composed of 122 points, and the attribute to be interpolated is Z, in the sample I attach.
I’ve interploated first in a narrow region around a peak. 5/122 points were used and the result is this:http://www.geospatial.it/allegri/IDW1.png, 491 rows x 552 columns of 2 meters cells.
Then I’ve widened the region in the same area: http://www.geospatial.it/allegri/IDW2.png. Ok
Then, when I’ve interpolated across the while area, the result is this strange over-smoothed surface: http://www.geospatial.it/allegri/IDW3.png , where I put in evidence the first small region.
Another wierd surface I got is: http://www.geospatial.it/allegri/IDW4.png , resulted from a lower resolution setting (50 meters) of the region.
About IDW3:
Why the interpolation fails to detect local anomalies while it gets wider?
It seems that the algorithm doesn’t manage correctly the incresing number of points vs search radius. I will try to take a look at the v.surv.idw code, and to understand what the nrowsxncols/npoints>400 threshold stands for…
I attach the sample shapefile with a “Z” attribute representing my interpolation values: http://www.geospatial.it/allegri/sample_allegri.zip
Giovanni
On Tue, 12 Feb 2008, G. Allegri wrote:
Hello everyone. In these days I was using IDW to make an easy interpolation
of a point features layer, and I faced a strange behaviour.
My dataset is composed of 122 points, and the attribute to be interpolated
is Z, in the sample I attach.
I've interploated first in a narrow region around a peak. 5/122 points were
used and the result is this:http://www.geospatial.it/allegri/IDW1.png, 491
rows x 552 columns of 2 meters cells.
Then I've widened the region in the same area:
http://www.geospatial.it/allegri/IDW2.png. Ok
Then, when I've interpolated across the while area, the result is this
strange over-smoothed surface: http://www.geospatial.it/allegri/IDW3.png ,
where I put in evidence the first small region.
Are you sure they are really that different? If you could use the same colour table for all three images, it would be a lot easier to see. I mean, are the values actually very different or are you just going by the colours?
If you still notice anomalies after assigning the same colour table to all the maps, I will definitely look into it, as I wrote a lot of the code in the current version of v.surf.idw.
Another wierd surface I got is: http://www.geospatial.it/allegri/IDW4.png ,
resulted from a lower resolution setting (50 meters) of the region.
About IDW3:
Why the interpolation fails to detect local anomalies while it gets wider?
It seems that the algorithm doesn't manage correctly the incresing number of
points vs search radius.
I'm not sure what you mean here. Can you explain further?
I will try to take a look at the v.surv.idw code,
and to understand what the nrowsxncols/npoints>400 threshold stands for...
It means, if the resolution is quite a lot larger than the number of points, it simply searches through all the points for each cell of the output raster to find the 12 closest, rather than using a search radius to only search those close by. It is just a bit faster. But if you can improve the way it detects this it would be very interesting as I'm not happy with the choice of such an arbitrary number.
Paul
Hi Paul. The anomalies are in the raster values, indipendently by the color table. If you do an r.what around the peak in IDW1 you get raster values corresponding to the point Z value (about 22000), while if you do r.what on IDW3 you get values arounf 2000…
2008/2/12, Paul Kelly <paul-grass@stjohnspoint.co.uk>:
On Tue, 12 Feb 2008, G. Allegri wrote:
Hello everyone. In these days I was using IDW to make an easy interpolation
of a point features layer, and I faced a strange behaviour.
My dataset is composed of 122 points, and the attribute to be interpolated
is Z, in the sample I attach.
I’ve interploated first in a narrow region around a peak. 5/122 points were
used and the result is this:http://www.geospatial.it/allegri/IDW1.png, 491
rows x 552 columns of 2 meters cells.
Then I’ve widened the region in the same area:
http://www.geospatial.it/allegri/IDW2.png. Ok
Then, when I’ve interpolated across the while area, the result is this
strange over-smoothed surface: http://www.geospatial.it/allegri/IDW3.png ,
where I put in evidence the first small region.
Are you sure they are really that different? If you could use the same
colour table for all three images, it would be a lot easier to see. I
mean, are the values actually very different or are you just going by the
colours?
If you still notice anomalies after assigning the same colour table to all
the maps, I will definitely look into it, as I wrote a lot of the code in
the current version of v.surf.idw.
Another wierd surface I got is: http://www.geospatial.it/allegri/IDW4.png ,
resulted from a lower resolution setting (50 meters) of the region.
About IDW3:
Why the interpolation fails to detect local anomalies while it gets wider?
It seems that the algorithm doesn’t manage correctly the incresing number of
points vs search radius.
I’m not sure what you mean here. Can you explain further?
I will try to take a look at the v.surv.idw code,
and to understand what the nrowsxncols/npoints>400 threshold stands for…
It means, if the resolution is quite a lot larger than the number of
points, it simply searches through all the points for each cell of the
output raster to find the 12 closest, rather than using a search radius to
only search those close by. It is just a bit faster. But if you can
improve the way it detects this it would be very interesting as I’m not
happy with the choice of such an arbitrary number.
Paul
Hi Paul,
are you still considering this post? If not I will try to dive in the algorithm by myself…
Giovanni
Hello Giovanni
On Tue, 12 Feb 2008, G. Allegri wrote:
Hi Paul,
are you still considering this post? If not I will try to dive in the
algorithm by myself...
I'm definitely interested in helping you get to the bottom of the problem and improving GRASS with whatever useful information we find out. But I can't promise to give it any particularly urgent consideration - also I've been out all day and have just got home 
I was waiting for you to answer the things I asked in my previous mail actually to see if they gave any more clues! I.e., can we see what the different maps look like when they all use the same colour table and also what did you mean by your concerns about the algorithm not managing something correctly.
Also, have you tried running using the -n flag (no indexing) and comparing the results. I think they should be the same for all regions then but might turn up something else interesting.
Hopefully when we have all this information available (command lines used too if you think they're relevant) we'll be able to see some kind of pattern emerging.
Also did you find my reference to the algorithm used (extract from my PhD thesis)? It should be in the mailing list archives of some old discussions of s.surf.idw/v.surf.idw if you search. I'll just go and dig it out again for you in case it's useful...
File /pub/users/paulk/grass/idw.ps.gz on ftp.qub.ac.uk (anonymous FTP).
It's gzipped PostScript - you'll need Ghostscript or similar to read it.
Paul