NAME
r.surf.nnbathy - Interpolate surface from rasterized input using Pavel Sakov's nn, a natural neighbor intepolation library.
SYNOPSIS
r.surf.nnbathy
r.surf.nnbathy help
r.surf.nnbathy input=name output=name alg=name
Parameters:
- input=name
- Input raster map name
- output=name
-
- Output raster map name
- alg=name
- Interpolation algorithm for nnbathy to use
- options: l,nn,ns
- default: nn
DESCRIPTION
r.surf.nnbathy is an UNIX Shell and Awk script. It is an interface between the external nnbathy utility and GRASS. nnbathy is a surface interpolation program, which uses the nn - a natural neighbor interpolation library. nnbathy and nn were written by Pavel Sakov.
r.surf.nnbathy provides the 3 interpolation algorithms available in nnbathy. According to nn library documentation these are: Delaunay interpolation (alg=l), Watson's algortithm for Sibson natural neighbor interpolation (alg=nn) and Belikov and Semenov's algorithm for non-Sibsonian natural neighbor interpolation (alg=ns). For performing the underlaying Delaunay triangulation in all cases nnbathy uses triangle software by Jonathan Richard Shewchuk.
The output raster map is a continous surface interpolated from the input raster map.
nnbathy, if built with '-DNN_SERIAL' switch, is able to output a grid of virtually any size. It interpolates and writes one output point at a time only. This eliminates necessity to hold the whole output array in memory. However, even then all the input cells are still held in the memory.
In order to install nnbathy with serial input processing enabled, do the following:
1. Download nn library
2. ./configure
3. make
4. gcc -o nnbathy nnbathy.c -g -O2 -Wall -pedantic -I. -DNN_SERIAL libnn.a -lm
5. chmod u+x ./nnbathy
Now copy the nnbathy executable to some directory in your PATH.
NOTES
1. Requires GRASS 6.x and nnbathy 1.76 or greater.
2. The output raster map extent and resolution match the region settings at which the script was started.
3. The output raster map non-NULL area is limited to the convex hull encompassing all the non-NULL input cells.
4. The output is double floating point raster map.
5. Natural neighbor is a an exact interpolation algorithm, so all non-NULL input cells have their value exactly preserved in the output.
6. There is circa 0.2 KB memory overhead per each input cell. However, the output grid can be of any size, if nnbathy is built with -DNN_SERIAL switch.
7. r.surf.nnbathy creates 3 temp files - plain ASCII x,y,z lists of the input and output cells, and the output one converted into GRASS ASCII format. Then it makes a GRASS raster map from the latter - and only then it removes the 3 temp files, when the script terminates. Thus, at the script run time several times more disk space might be required, than the resulting GRASS raster map actually occupies.
I'd like to thank Pavel Sakov for all his support in regard to nn and nnbathy usage, and especially for implementing serial input processing.
SEE ALSO
v.to.rast
AUTHOR
Maciej Sieczka, Wroclaw, Poland, 2006-2008
sieczka at biol.uni.wroc.pl
Wroclaw University, Intitute of Plant Biology
Developed within the course and for the purpose of the CAVES project, funded
under EU 6FP NEST programme.