[GRASS-dev] Update of r.surf.idw to FP

Helena Mitasova hmitaso at unity.ncsu.edu
Tue Mar 20 18:37:28 EDT 2007


On Mar 20, 2007, at 4:51 PM, Paul Kelly wrote:

>
>
> On Tue, 20 Mar 2007, Markus Neteler wrote:
>
>> On Tue, Mar 20, 2007 at 06:24:09PM +0000, Glynn Clements wrote:
>>>
>>> Markus Neteler wrote:
>>>
>>>> I have tried to update r.surf.idw to floating point:
>>>> http://mpa.itc.it/markus/tmp/rsurfidw.diff
>>>>
>>>> but I am not quite sure if this is efficient like this.
>>>> Currently it doesn't compile due to some "extern" magic
>>>> which I don't quite understand.
>>>> I have been inspired by r.example.
>>>
>>> The problem is that you have renamed some (but not all)  
>>> occurrences of
>>> "cell" to "outrast", although the variable is still called "cell".
>>
>> I see.
>> Thinking about it again: probably it is a waste of time.
>>
>> Proposal:
>> - write a script to emulate r.surf.idw[2], calling
>>   - r.to.vect
>>   - v.surf.idw
>> - retire r.surf.idw and r.surf.idw2, substitute them by this script.
>>
>> Since both r.surf.idw and r.surf.idw2 are half broken (r.surf.idw2  
>> more
>> than the other) and v.surf.idw works, this might be the least cost  
>> path
>> for maintenance.
>
>> From reading the manpage, it looks like r.surf.idw has some  
>> features that
> aren't present in v.surf.idw. E.g. correct calculation of distances  
> in lat/long locations, error output. However r.surf.idw2 doesn't  
> look very useful. It seems that the functionality of r.surf.idw2  
> would be better kept as a command-line option for r.surf.idw.  
> Perhaps the author of r.surf.idw had in mind that this improved  
> version would replace r.surf.idw2, but the GRASS developers at the  
> time were hesitant and kept it on in case anybody needed it?

Paul you are right - r.surf.idw2 is the original (or first) idw that  
was written by Mike Shapiro, a more sophisticated
version was then contributed by Greg - I actually thought that he  
also contributed a site version -
but apparently v.surf.idw is based on Mike's version improved by you.  
I think r.surf.idw2 was kept
as the "original, GRASS native" IDW as opposed to contributed  
r.surf.idw.

Given that r.surf.idw has built-in, working crossvalidation I would  
keep it and retire r.surf.idw2, but please whoever
has suitable data try it out - we should decide based on how these  
modules work
and whether they produce valid results (with the new data set that we  
are working on,
I could not getting decent results with r.surf.idw2 - it won't work  
even with smaller rasters,
both r.surf.idw and v.surf.idw worked better although they had some  
problems too.) the only issue
with r.surf.idw is that you need to convert your points to raster and  
by that you are introducing
a horizontal error so the results of crossvaliadtion are not as  
useful as if it was done
from the original points (e.g. in v.surf.idw) and the results are  
integer (but that can be fixed).

Helena



>
> Paul
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev




More information about the grass-dev mailing list