GRASS logo

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

NAME - Interpolates a raster map using the nnbathy natural neighbor interpolation program.


vector, surface, interpolation, natural, neighbor

SYNOPSIS --help input=name output=name [algorithm=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input raster map
output=name [required]
Name of output raster map
Options: l, nn, ns
Default: nn
l: Linear
nn: Sibson natural neighbor
ns: Non-Sibsonian natural neighbor

Table of contents

DESCRIPTION is an interface between the external nnbathy utility and GRASS. nnbathy is a surface interpolation program provided with nn - a natural neighbor interpolation library, written by Pavel Sakov. provides 3 interpolation algorithms. 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 data.


nnbathy, if built with '-DNN_SERIAL' (default as of nn 1.85), is able to create a grid of virtually any size. It interpolates and writes one output point at a time only. This eliminates the necessity to hold the whole output array in memory. However, even then all the input points are still held in the memory.
  1. Requires GRASS 7 and nnbathy 1.76 or greater.
  2. Build nnbathy according to instructions provided with its source code and put it somewhere in your $PATH.
  3. The output raster map extent and resolution match the region settings at which the script was started.
  4. The output raster map non-NULL area is limited to the convex hull encompassing all the non-NULL input cells.
  5. The output is double precision floating point raster map (DCELL).
  6. Natural neighbor is a an exact interpolation algorithm, so all non-NULL input points have their value exactly preserved in the output.
  7. 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.
  8. creates 3 temporary files: ASCII x,y,z lists of the input points and output cells, and the output list 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 final GRASS raster map would actually occupy.


g.region raster=elevation@PERMANENT -p
r.random input=elevation@PERMANENT n=100000 raster_output=random_points input=random_points output=raster_map
d.rast map=raster_map




Adam Laza, OSGeoREL, Czech Technical University in Prague (mentor: Martin Landa)

based on from GRASS 6 by
Hamish Bowman, Otago University, New Zealand
Based on by Maciej Sieczka


Available at: source code (history)

Latest change: Monday Jan 30 19:52:26 2023 in commit: cac8d9d848299297977d1315b7e90cc3f7698730

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual