SurfaceInterpolator

Interpolates the values of a vector of points, as elevations or measurements, onto the grid of a raster: each cell is computed from the points within the buffer distance around it, with one of two methods:

  • TPS, Thin Plate Splines: a smooth surface through the points, good for sparse points;

  • IDW, Inverse Distance Weighting: the average of the points, weighted by the inverse of their distance, more robust with dense points.

The buffer must contain enough points for each cell: where there are none, the cell stays empty. With dense and irregular points, as those of a lidar survey, TPS can become unstable and give absurd values: IDW is the safer choice.

Parameters

Interpolates the values of a vector of points onto the grid of a raster, with Thin Plate Splines or Inverse Distance Weighting: each cell is computed from the points within the buffer distance around it.

Toolbox folder: Raster Processing
Status: Draft
Keywords: Interpolation, Raster, Points, Spline, IDW
Authors: Jan Jezek, Andrea Antonello
Class: org.hortonmachine.modules.SurfaceInterpolator

Inputs

Parameter

Type

Unit

Default

Description

inVector

vector file

The vector of the points to interpolate.

inGrid

raster file

The raster whose grid, extent and cell size, the output takes.

inMask

raster file

An optional raster: the values are computed only where it has values.

fCat

String

The field of the points with the values to interpolate.

pMode

String

TPS

The interpolation: TPS (Thin Plate Splines), smooth, or IDW (Inverse Distance Weighting), more robust with dense points. Allowed values: TPS, IDW.

pBuffer

double

m

4.0

The distance around each cell within which the points are used.

pMaxThreads

int

number of processors

Max threads to use.

Outputs

Parameter

Type

Unit

Description

outRaster

output file

The interpolated raster.

Example

The example runs on the sample lidar survey of the manual, uni_bz_plot777.las in docs/manual/modules/maps/data, a forest plot of 60 x 60 m with its elevation model dtm_777.tif:

import org.hortonmachine.modules.SurfaceInterpolator

// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"

// the surface of the lidar points of LasConverter, on the grid of the plot elevation model
var interpolator = new SurfaceInterpolator()
interpolator.inVector = folder + "las_points.shp"
interpolator.fCat = "elev"
interpolator.inGrid = folder + "dtm_777.tif"
interpolator.pMode = "IDW"
interpolator.pBuffer = 2.0
interpolator.outRaster = folder + "dsm_777.tif"
interpolator.process()
The surface of the lidar points of the sample plot, interpolated with IDW on the 0.5 m grid of its elevation model: the top of the trees and the ground between them.

The surface of the lidar points of the sample plot, interpolated with IDW on the 0.5 m grid of its elevation model: the top of the trees and the ground between them.

The same surface minus the elevation model of the ground: the height of the trees, in meters, with the crowns up to about 20 m.

The same surface minus the elevation model of the ground: the height of the trees, in meters, with the crowns up to about 20 m.