NNINT -- Natural Neighbour Interpolation

Generates a raster image by interpolating image values between specified pixel locations using natural neighbour interpolation. This program uses the NNGRIDR code developed by Dr. D.F. Watson at the University of Western Australia.

Progress of this program can be monitored. See MONITOR section.

See Also: GRDPNT, GRDPOL, GRDVEC, GRDINT

PARAMETERS

NNINT is controlled by the following global parameters :

Name     Prompt                                  Count     Type
FILI     Vector File Name                        1-64      Char
FILO     Database File Name                      1-64      Char
DBVS     Database Vector Segment                 0-1       Int
DBOC     Database Output Channel list            1         Int
DBOW     Database Output Window                  0-4       Int
EXTRAP   Extrapolation:  ON/OFF                  1-3       Char
FLDNME   Attribute Field Name                    0-64      Char

FILI

Specifies the name of the GDB file which contains the GDB layer information.

 EASI>FILI="filespec"

FILO

Specifies the name of the GDB raster file to receive the interpolated images.

 EASI>FILO="filespec"
If FILI and FILO are raster files, then FILI can be equal FILO.

DBVS

Specifies the vector segment in which the attribute value or the z coordinate will be used as the basis for interpolation.

 EASI>DBVS=i
The vector segment can specify an arbitrary number of structures.

DBOC

Specifies the image channel, on FILO, to receive the interpolated result.

 EASI>DBOC=i

DBOW

Specifies a rectangular subset of the image database to be used.

 EASI>DBOW=Xoffset,Yoffset,Xsize,Ysize
 EASI>DBOW=                             | use entire image
The offset + size must not exceed the image size.

EXTRAP

  Valid Values:   ON, OFF
  Default:        ON
Specifies whether to do extrapolation or not. If EXTRAP is ON, then pixels within output image size but beyond the convex hull of data are extrapolated. If EXTRAP is OFF, then these pixels are set to

 EXTRAP = ON    | extrapolate outer boundary (default)
 EXTRAP = OFF   | set outer boundary pixel values to -150

FLDNME

  Valid Values:   ATTRIBUTE, ZCOORD, ELEVATION
  Default:        ATTRIBUTE
Specifies the field containing the elevation values.

If this parameter is not specified, it defaults to "Attribute". If this parameter is specified as ZCOORD, then the actual Z-coordinates of the vectors are used. The names are not case sensitive, and the entire name need not be specified. If more than one match exists, the first name is used.

 ATTRIBUTE      -> The attribute of the vector segment is used. 
 ZCOORD         -> The actual Z-coordinates of the vectors are used.  
 ELEVATION      -> The vector field called "ELEVATION" is used.

MONITOR

Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:

 EASI>MONITOR="ON"           | turn monitor ON  (default)
 EASI>MONITOR="OFF"          | turn monitor OFF (recommended if
                             | running in batch/background mode)

DETAILS

NNINT is used to read the grey level values for an arbitrary number of pixel locations in order to generate a raster image based upon interpolation between the specified grey levels. It adopts the Natural Neighbour Interpolation algorithm.

The grey level values are read from either a GDB layer or a database vector segment stored on the database file.

ALGORITHM

NNINT implements the Natural Neighbour Interpolation algorithm using the NNGRIDR code developed by Dr. D.F. Watson at the University of Western Australia.

The Natural Neighbour coordinate was invented by Professor Robin Sibson, [Sibson 1980]. It is a coordinate that could have more than one reference point. It is measured by the ratio of the area associated with one of the reference points to the total area surrounded by all reference points. Further details can be found in

 A vector identity for the Dirichlet tessellation,
 Math Proc. Cambridge Phil. Soc., 87
Data from the GDB layer or DBVC are examined and modified to the correct format. Then they are fed along with the other parameters to NNInterpolate() which will find all the natural neighbours and perform the interpolation.

Data are natural neighbours when they are located on the circumference of a circle. Natural neighbours of a set of data are found by laying down the least number of the largest possible circles which cover completely the convex hull of data, with no data lying inside any circle. It has been found that this could be achieved by constructing each circle with exactly three data points which form a Delaunay triangle.

For any location inside a circle, its interpolated value is influenced by the three data points of the Delaunay triangle weighted by the Natural Neighbour coordinates, with respect to each of the three data points, of that location.

The interpolated value of a location will be based on the influence from all the circles that it intercepts. It equals the summation of the product of the Natural Neighbour's coordinate and the grey level of each data point.

        ___
f(x) =  \   Nx(i) * f(P(i))
        /__ 
         i
 f(x)     is the interpolated value of location x.
 Nx(i)    is the Natural Neighbour coordinate of x with respect to i.
 f(P(i))  is the grey level value of point P at location i.
PCI would like to thank Dr. Dave Watson for his code in "NNGRIDR" which implements Natural Neighbour Interpolation.

EXAMPLE

Example 1

The following example will read XYZ data from the GDB layer, dem100.dat and write the results to the raster file irvine.pix, on output channel 8.

 EASI>FILI="dem100.dat;XYZ"        | GDB layer to contain points 
 EASI>FILO="irvine.pix"
 EASI>DBVS=                        | input not from DBVS
 EASI>DBOC=8                       | channel to receive result
 EASI>DBOW=                        | entire image
 EASI>EXTRAP="YES"                 | extrapolate
 EASI>FLDNME=                      | not needed
 EASI>RUN NNINT
Example 2

The following example will use the RTV task to generate a vector segment containing point data from channel 6 of the database irvine.pix. The points of this vector segment will serve as input to create an interpolated image channel.

 EASI>FILE="irvine.pix"
 EASI>DBIC=6                  | input channel (a classification)
 EASI>DBIW=                   | use entire image
 EASI>DBSN="NNINT"            | points for NNINT
 EASI>DBSD=                   | not needed
 EASI>POLYINFO="POINTS"       | DBVS to contain only point data
 EASI>BORDER=                 | not needed
 EASI>CONTINT=                | not needed
 EASI>RUN RTV
Create an interpolated output channel using NNINT.

 EASI>FILI="irvine.pix"       | file that contains vector seg.
 EASI>FILO="irvine.pix"       | database file to receive result
 EASI>DBVS=LASC               | input data from DBVS not TFILE
 EASI>DBOC=8                  | channel to receive result
 EASI>DBOW=                   | entire image
 EASI>EXTRAP="YES"            | extrapolate
 EASI>FLDNME=                 | use grey value from attribute
 EASI>RUN NNINT

SPEED

The order of complexity of this program is O(n^2) for n data. For a local area within a large data set, it is recommended that you restrict the output image size by specifying it with the DBOW parameter.

It takes about 8.9 seconds to run on the text file "dem100.dat" on a Digital AXP machine.


About PCI Help Gateway