Class TLcdHypsometricSlope

java.lang.Object
com.luciad.tea.hypsometry.TLcdHypsometricSlope
All Implemented Interfaces:
ILcdHypsometricValueProvider

public class TLcdHypsometricSlope extends Object implements ILcdHypsometricValueProvider
This ILcdHypsometricValueProvider computes the cosine of the angle between a given 3D reference direction and the normal. The reference direction should generally have a positive z-component. Negative cosine values are clamped to 0, so the values lie in the range [0, 1].

This provider is typically useful for computing hill shading, by selecting a reference direction that specifies the direction of the sun (in the local coordinate system of the raster). The computed values then correspond to diffuse shading resulting from the sunlight, ranging for 0 for unlit areas to 1 for brightly lit areas.

  • Constructor Details

    • TLcdHypsometricSlope

      public TLcdHypsometricSlope()
      Creates a new TLcdHypsometricSlope for the reference direction (0, 0, 1).
    • TLcdHypsometricSlope

      public TLcdHypsometricSlope(double aReferenceDirectionX, double aReferenceDirectionY, double aReferenceDirectionZ)
      Creates a new TLcdHypsometricSlope for the given reference direction. The direction does not have to be normalized. The normal provider is a default, which computes normals based on 2x2 samples.
      Parameters:
      aReferenceDirectionX - the x component of the reference direction.
      aReferenceDirectionY - the y component of the reference direction.
      aReferenceDirectionZ - the z component of the reference direction.
    • TLcdHypsometricSlope

      public TLcdHypsometricSlope(double aReferenceDirectionX, double aReferenceDirectionY, double aReferenceDirectionZ, ILcdHypsometricNormalProvider aHypsometricNormalProvider)
      Creates a new TLcdHypsometricSlope for the given reference direction and normal provider. The direction does not have to be normalized.
      Parameters:
      aReferenceDirectionX - the x component of the reference direction.
      aReferenceDirectionY - the y component of the reference direction.
      aReferenceDirectionZ - the z component of the reference direction.
      aHypsometricNormalProvider - the normal provider.
  • Method Details

    • getReferenceDirectionX

      public double getReferenceDirectionX()
      Returns the x component of the reference direction.
      Returns:
      the x component of the reference direction.
    • getReferenceDirectionY

      public double getReferenceDirectionY()
      Returns the y component of the reference direction.
      Returns:
      the y component of the reference direction.
    • getReferenceDirectionZ

      public double getReferenceDirectionZ()
      Returns the z component of the reference direction.
      Returns:
      the z component of the reference direction.
    • getHypsometricNormalProvider

      public ILcdHypsometricNormalProvider getHypsometricNormalProvider()
      Returns the normal provider.
      Returns:
      the normal provider.
    • getFootPrint

      public Rectangle getFootPrint()
      Description copied from interface: ILcdHypsometricValueProvider
      Returns the foot print of this provider. For instance, if the hypsometric value at each point is computed based on the surrounding 3x3 matrix values, the foot print is the rectangle (-1, -1, 3, 3).
      Specified by:
      getFootPrint in interface ILcdHypsometricValueProvider
      Returns:
      the foot print of this provider.
    • getMinimumValue

      public double getMinimumValue()
      Description copied from interface: ILcdHypsometricValueProvider
      Returns the minimum hypsometric value that this provider may return.
      Specified by:
      getMinimumValue in interface ILcdHypsometricValueProvider
      Returns:
      the minimum hypsometric value.
    • getMaximumValue

      public double getMaximumValue()
      Description copied from interface: ILcdHypsometricValueProvider
      Returns the maximum hypsometric value that this provider may return.
      Specified by:
      getMaximumValue in interface ILcdHypsometricValueProvider
      Returns:
      the maximum hypsometric value.
    • computeValue

      public double computeValue(ILcdMatrixView aMatrixView, int aX, int aY, double aElevationScale)
      Description copied from interface: ILcdHypsometricValueProvider
      Computes the hypsometric value at the given point.
      Specified by:
      computeValue in interface ILcdHypsometricValueProvider
      Parameters:
      aMatrixView - the matrix containing elevation values.
      aX - the x ordinate in the matrix.
      aY - the y ordinate in the matrix.
      aElevationScale - the scale of the elevation values in the tiles, expressed in matrix units per tile elevation unit.
      Returns:
      the computed hypsometric value, or NaN if it is unknown, for instance if not all required elevations are known.