public class InverseDistanceWeightingInterpolator extends Object implements IInterpolatorOverTin
This class is intended primarily for diagnostic purposes and does not implement a comprehensive set of options in support of the inverse distance-weighting concept.
Constructor and Description |
---|
InverseDistanceWeightingInterpolator(IIncrementalTin tin)
Construct an interpolator that operates on the specified TIN.
|
InverseDistanceWeightingInterpolator(IIncrementalTin tin,
double parameter,
boolean gaussian)
Constructs an interpolator using the specified method.
|
Modifier and Type | Method and Description |
---|---|
static double |
computeAverageSampleSpacing(IIncrementalTin tin)
Computes the average sample spacing.
|
static double |
estimateNominalBandwidth(double pointSpacing)
Estimates a nominal bandwidth for the Gaussian kernal method of
interpolation
using the mean length of the distances between samples
|
String |
getMethod()
Gets a string describing the interpolation method
that can be used for labeling graphs and printouts.
|
double[] |
getSurfaceNormal()
Not supported at this time.
|
double |
interpolate(double x,
double y,
IVertexValuator valuator)
Perform inverse distance weighting interpolation.
|
boolean |
isSurfaceNormalSupported()
Indicates whether the interpolation class supports the computation
of surface normals through the getUnitNormal() method.
|
void |
printDiagnostics(PrintStream ps)
Prints diagnostic information about sample sizes and spacing
used for interpolation
|
void |
resetForChangeToTin()
Used by an application to reset the state data within the interpolator
when the content of the TIN may have changed.
|
String |
toString() |
public InverseDistanceWeightingInterpolator(IIncrementalTin tin)
This constructor creates an interpolator based on Shepard's classic weight = 1/(d^2) formula.
tin
- a valid instance of an incremental TIN.public InverseDistanceWeightingInterpolator(IIncrementalTin tin, double parameter, boolean gaussian)
Gaussian Kernel: If the Gaussian Kernel option is specified, the parameter will be interpreted as the bandwidth (lambda) for the formula weight = exp(-(1/2)(d/lambda)).
Power formula: If the Gaussian Kernel options is not specified, the parameter will be interpreted as a power for the formula weight = 1/pow(d, power);
tin
- a valid TINparameter
- a parameter specifying either bandwidth (for Gaussian)
or power. In both cases the parameter must be greater than zero.gaussian
- true if the Gaussian kernel is to be used; otherwise
the non-Gaussian method (power) will be usedpublic void resetForChangeToTin()
resetForChangeToTin
in interface IProcessUsingTin
public double interpolate(double x, double y, IVertexValuator valuator)
This interpolation is not defined beyond the convex hull of the TIN and this method will produce a Double.NaN if the specified coordinates are exterior to the TIN.
interpolate
in interface IInterpolatorOverTin
x
- the x coordinate for the interpolation pointy
- the y coordinate for the interpolation pointvaluator
- a valid valuator for interpreting the z value of each
vertex or a null value to use the default.public boolean isSurfaceNormalSupported()
IInterpolatorOverTin
isSurfaceNormalSupported
in interface IInterpolatorOverTin
public double[] getSurfaceNormal()
getSurfaceNormal
in interface IInterpolatorOverTin
public String getMethod()
IInterpolatorOverTin
getMethod
in interface IInterpolatorOverTin
public static double estimateNominalBandwidth(double pointSpacing)
pointSpacing
- a positive valuepublic static double computeAverageSampleSpacing(IIncrementalTin tin)
In many cases, the sample spacing of the perimeter edges of a TIN is much larger than the mean sample spacing for the interior. So if the TIN contains more than 3 points, the perimeter edges are not included in the tabulation.
tin
- a valid instancepublic void printDiagnostics(PrintStream ps)
ps
- a valid instance (such as System.out).Copyright © 2021. All rights reserved.