[GRASS5] s.surf.idw improvements and region settings

Eric G. Miller egm2 at jps.net
Thu Mar 27 10:47:52 EST 2003

On Thu, Mar 27, 2003 at 11:06:34AM +0000, Paul Kelly wrote:
> Hello everybody
> I've made an improvement to s.surf.idw to greatly improve its efficiency
> when dealing with a large number of sites for interpolation, which I'm
> thinking of commiting to CVS. The improvement is that when initially
> reading the sites file it indexes all the sites according to what cell they
> fall into, so that when it is later searching for the 12 nearest sites it
> doesn't have to search through them all, just those indexed to the current
> and nearby cells. Currently for each output cell it searches through all
> the sites in the input file and calculates the distance to each one in
> order to find the 12 nearest sites. With a few hundred thousand sites this
> can cause it to take hours to run; with the improvements it takes only a
> few minutes.

I have thought about adding some general indexing for sites files to
libgis, as there a several programs where it could be useful.  However,
it seemed with the move to erase the distinction between "sites" and
vector points in 5.1, that it would be a bit late to add such a thing
now.  It seems a worthy addition to s.surf.idw though...

As to other inconsistency ... ?  Generally raster producing operations
should respect the region and mask out of the box, possibly allowing
an override of the region (I don't see a good reason to override the
mask, generally, since the user can just turn it off).  The notable
exception to this rule is import routines where the region of the
process should be made to match the input(s).

echo ">gra.fcw at 2ztr< eryyvZ .T pveR" | rot13 | reverse

More information about the grass-dev mailing list