Class TLcdImageHeightProvider

java.lang.Object
com.luciad.util.height.TLcdImageHeightProvider
All Implemented Interfaces:
ILcdBounded, ILcdHeightProvider

public class TLcdImageHeightProvider extends Object implements ILcdHeightProvider
A height provider which can read values out of an ALcdBasicImage. The image must be single-banded. This provider needs an ALcdImagingEngine to read values out of the image. It can be supplied externally or the provider can create its own.

This height provider takes the sampling mode of the image into account. Assuming interpolation is off:

  • Point-sampled: the sample nearest to the requested coordinates is returned
  • Area-sampled: the sample containing the requested coordinates is returned
When interpolation is enabled, area-sampled images are treated as if sample points lie in the center of each pixel.
Since:
2014.0
  • Constructor Details

    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdBasicImage aImage)
      Create a new height provider.

      Heights outside the range of -12000 to 10000 are returned as invalid (Double.NaN).

      Parameters:
      aImage - image to read elevation values from
    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdBasicImage aImage, ALcdImagingEngine aImagingEngine)
      Create a new height provider for a given image and imaging engine.

      Heights outside the range of -12000 to 10000 are returned as invalid (Double.NaN).

      If the given imaging engine is null, a default imaging engine will be used.

      Parameters:
      aImage - image to read elevation values from
      aImagingEngine - imaging engine to use or null to use the default
    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdBasicImage aImage, ALcdImagingEngine aImagingEngine, int aMinValidHeight, int aMaxValidHeight)
      Create a new height provider for a given image and imaging engine.

      If the given imaging engine is null, a default imaging engine will be used.

      Parameters:
      aImage - image to read elevation values from
      aImagingEngine - imaging engine to use or null to use the default
      aMinValidHeight - the minimum valid height
      aMaxValidHeight - the maximum valid height
    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdImageMosaic aImageMosaic)
      Create a new height provider using a default imaging engine.

      Heights outside the range of -12000 to 10000 are returned as invalid (Double.NaN).

      Parameters:
      aImageMosaic - image mosaic to read elevation values from
    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdImageMosaic aImageMosaic, ALcdImagingEngine aImagingEngine)
      Create a new height provider.

      Heights outside the range of -12000 to 10000 are returned as invalid (Double.NaN).

      If the given imaging engine is null, a default imaging engine will be used.

      Parameters:
      aImageMosaic - image mosaic to read elevation values from
      aImagingEngine - imaging engine to use or null to use the default
    • TLcdImageHeightProvider

      public TLcdImageHeightProvider(ALcdImageMosaic aImageMosaic, ALcdImagingEngine aImagingEngine, int aMinValidHeight, int aMaxValidHeight)
      Create a new height provider.

      If the given imaging engine is null, a default imaging engine will be used.

      Parameters:
      aImageMosaic - image mosaic to read elevation values from
      aImagingEngine - imaging engine to use or null to use the default
      aMinValidHeight - the minimum valid height
      aMaxValidHeight - the maximum valid height
  • Method Details

    • setInterpolate

      public void setInterpolate(boolean aInterpolate)
      Set whether height values should be interpolated. By default, values are retrieved by nearest neighbor.
      Parameters:
      aInterpolate - true if height values should be interpolated.
    • retrieveHeightAt

      public double retrieveHeightAt(ILcdPoint aPoint)
      Description copied from interface: ILcdHeightProvider
      Returns the height at the given point.
      Specified by:
      retrieveHeightAt in interface ILcdHeightProvider
      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

      public final ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the ILcdBounds by which the geometry of this ILcdBounded 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 of TLcdLonLatBounds or TLcdXYBounds.

      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the ILcdBounds by which the geometry of this ILcdBounded object is bounded.