Package com.luciad.util.height
Class TLcdInterpolatingRasterHeightProvider
java.lang.Object
com.luciad.util.height.TLcdInterpolatingRasterHeightProvider
- All Implemented Interfaces:
ILcdBounded
,ILcdHeightProvider
This height provider retrieves its heights from a given raster using interpolation
between height values to gain a smoother result.
The interpolation method is illustrated in the following figure :
The interpolation is implemented by defining an area around the given point, the size of a pixel. Each corner of this area lies onto a different pixel of the raster. For each of these pixels, the value is retrieved from the raster (sampling of the pixel values is done at the pixel center). These values are then combined by weighted average according to area (w1, w2, w3, w4).
- Since:
- 9.1
-
Constructor Summary
ConstructorDescriptionCreates a new height provider based on the given raster.TLcdInterpolatingRasterHeightProvider
(ILcdRaster aRaster, int aMinValidHeight, int aMaxValidHeight) Creates a new height provider based on the given raster. -
Method Summary
Modifier and TypeMethodDescriptionReturns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.double
retrieveHeightAt
(ILcdPoint aPoint) Returns the height at the given point.
-
Constructor Details
-
TLcdInterpolatingRasterHeightProvider
Creates a new height provider based on the given raster. Raster heights outside the range of -12000 to 10000 are returned as invalid (Double.NaN
). The height provider interpolates the height values to gain a smoother result.- Parameters:
aRaster
- the raster from which the heights will be retrieved.
-
TLcdInterpolatingRasterHeightProvider
public TLcdInterpolatingRasterHeightProvider(ILcdRaster aRaster, int aMinValidHeight, int aMaxValidHeight) Creates a new height provider based on the given raster. Raster heights outside the given range are returned as invalid (Double.NaN
). The height provider interpolates the height values to gain a smoother result.- Parameters:
aRaster
- the raster from which the heights will be retrieved.aMinValidHeight
- the minimum valid height.aMaxValidHeight
- the maximum valid height.
-
-
Method Details
-
retrieveHeightAt
Description copied from interface:ILcdHeightProvider
Returns the height at the given point.- Specified by:
retrieveHeightAt
in interfaceILcdHeightProvider
- Parameters:
aPoint
- a 2D point, in the horizontal reference that is determined by the implementation.- Returns:
- the elevation at the given point, in the vertical reference that
is determined by the implementation. The value may also be
Double.NaN
, if the elevation is not known.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-