NAME
r.surf.nnbathy - Interpolate surface from rasterized input using nn natural neighbor intepolation library.
SYNOPSIS
r.surf.nnbathy
r.surf.nnbathy help
r.surf.nnbathy input=name output=name
Parameters:
- input=name
- Input raster name
- output=name
- Output raster name
DESCRIPTION
r.surf.nnbathy is a Bash and Awk script. It is an interface between the external nnbathy utility and Grass. nnbathy is a surface interpolation program, which uses nn - a natural neighbor interpolation library. nnbathy and nn were written by
Pavel Sakov. nn uses triangle software by
Jonathan Shewchuk for performing the Delaunay triangulation.
The output raster contains a continous surface interpolated from the input raster.
There is no limitation in regard to the shape and distribution of the input cells. The input could be e.g. open or closed elevation contour lines, elevation points, areas and any combination of these. Natural neighbor algorithm exactly follows the input data and is able to produce a good result from very clustered, heterogenous input. It will preserve any rapid value gradient present in the input. It doesn't produce artificial bulges or hollows between the distant input data, only a linear, continous surface. It might lead to bogus flat areas in case of kidney-like shaped contour lines in input.
nnbathy, if built with '-DNN_SERIAL' switch, is able to handle a grid of virtually any size, using very little memory. It reads, interpolates and writes one output point at a time only. This eliminates necessity to hold the whole output array in memory.
In order to install nnbathy with serial input processing enabled, do the following:
1. Download nn.tar.gz from http://www.marine.csiro.au/~sakov/
2. tar xzvf nn.tar.gz
3. cd nn
4. ./configure
5. make
6. gcc -o nnbathy nnbathy.c -g -O2 -Wall -pedantic -I. -DNN_SERIAL libnn.a -lm
7. chmod u+x ./nnbathy
Now copy the nnbathy executable to a directory listed in your PATH.
NOTES & CAVEATS
1. The output extent and resolution will match the current region settings.
2. The output non-NULL area will be limited to the convex hull encompassing all the non-NULL input cells.
3. The output is double floating point raster.
4. Natural neighbor is a an exact interpolation algorithm, so all non-NULL input cells have their value exactly preserved in the output.
5. The script will work with nnbathy version 1.63 and higher.
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
Pavel Sakov
AUTHOR
Maciej Sieczka, Wroclaw, Poland, 2006
Wroclaw University, Intitute of Plant Biology