Class TLcdDensityBasedRasterElevationProvider

All Implemented Interfaces:
ILcdAltitudeProvider

public class TLcdDensityBasedRasterElevationProvider extends ALcdModelBasedTerrainElevationProvider
This implementation of ALcdTerrainElevationProvider retrieves the elevation from a number of models containing ILcdRaster and/or ILcdMultilevelRaster instances. The raster to be used for retrieving the elevation is chosen by comparing the pixel densities of the rasters with the desired pixel density. The desired pixel density can be set using setPixelDensity.

Note that the pixel density only makes sense with respect to a certain reference. By default, this reference is a standard geodetic reference. This means pixel densities are given in pixels per square degree. The reference can be changed by setPixelDensityReference.

This class should NOT be used by multiple threads at the same time!

  • Constructor Details

    • TLcdDensityBasedRasterElevationProvider

      public TLcdDensityBasedRasterElevationProvider()
      Defines an ALcdModelBasedTerrainElevationProvider which retrieves elevation values from the raster with the pixel density closest to the desired pixel density.
  • Method Details

    • retrieveElevationAt

      public double retrieveElevationAt(ILcdPoint aModelPoint, ILcdGeoReference aModelPointReference)
      Returns the elevation for a given location, defined in meters above the geoid from the given location reference.

      Special elevation values should be interpreted as defined by the altitude descriptor (from ALcdTerrainElevationProvider.getAltitudeDescriptor()). Keep in mind that Double.NaN, Double.NEGATIVE_INFINITY and Double.POSITIVE_INFINITY can also be used as special values.

      This implementations uses the raster with the pixel density closest to the desired pixel density to retrieve the altitude value for the given location.

      Specified by:
      retrieveElevationAt in class ALcdTerrainElevationProvider
      Parameters:
      aModelPoint - The point indicating the location for which to retrieve the elevation.
      aModelPointReference - The reference in which the given location is defined. Note that the ellipsoid from this reference should be used to define the returning elevation value.
      Returns:
      the elevation for a given location, defined in meters above the ellipsoid.
    • addModel

      public void addModel(ILcdModel aModel)
      Description copied from class: ALcdModelBasedTerrainElevationProvider
      Add a model to the list of models to be taken into account for retrieving elevation data.
      Overrides:
      addModel in class ALcdModelBasedTerrainElevationProvider
      Parameters:
      aModel - The model to be added.
    • removeModel

      public void removeModel(ILcdModel aModel)
      Description copied from class: ALcdModelBasedTerrainElevationProvider
      Remove a model from list set of models to be taken into account for retrieving elevation data.
      Overrides:
      removeModel in class ALcdModelBasedTerrainElevationProvider
      Parameters:
      aModel - The model to be removed.
    • removeAllModels

      public void removeAllModels()
      Description copied from class: ALcdModelBasedTerrainElevationProvider
      Empty the list of models to be taken into account for retrieving elevation data.
      Overrides:
      removeAllModels in class ALcdModelBasedTerrainElevationProvider
    • getPixelDensityReference

      public ILcdGeoReference getPixelDensityReference()
      Gets the reference in which the pixel density is defined. The default is a geodetic reference with WGS84 geodetic datum. This means the pixel density is then defined in pixels per square degree.
      Returns:
      The pixel density reference.
      See Also:
    • setPixelDensityReference

      public void setPixelDensityReference(ILcdGeoReference aPixelDensityReference)
      Set the reference in which the pixel density is defined. The default is a geodetic reference with WGS84 geodetic datum. This means the pixel density is then defined in pixels per square degree.
      Parameters:
      aPixelDensityReference - The pixel density reference.
      See Also:
    • getPixelDensity

      public double getPixelDensity()
      Gets the pixel density value. The pixel density is defined with respect to the pixelDensityReference. This value is specified in pixels per square reference unit. When retrieving elevation data, the raster with pixel density closest to this one is used.
      Returns:
      The pixel density.
      See Also:
    • setPixelDensity

      public void setPixelDensity(double aPixelDensity)
      Set the pixel density value.
      Parameters:
      aPixelDensity - The pixel density.
      See Also:
    • transformPixelDensity

      protected double transformPixelDensity(double aPixelDensity, ILcdGeoReference aSourceReference, ILcdGeoReference aDestinationReference)
      Transforms a pixel density in aSourceReference to a pixel density in aDestinationReference.
      Parameters:
      aPixelDensity - The original pixel density to be transformed.
      aSourceReference - The reference system of the original pixel density.
      aDestinationReference - The reference system of the transformed pixel density.
      Returns:
      The transformed pixel density.
    • computePixelDensityFromDistanceDelta

      public static double computePixelDensityFromDistanceDelta(double aDistanceDelta, boolean aMeters)
      Computes a pixel density value from a given distance (pixel width). If aMeters is true, the given distance is assumed to be in meters and the output will be an approximated pixel density in pixels per square degree (lon/lat). If aMeters is false, the given distance is assumed to be in model units and the resulting pixel density will also be in pixels per square model unit.
      Parameters:
      aDistanceDelta - The distance value or pixel width.
      aMeters - True if the distance is in meters.
      Returns:
      Pixel density in pixels per square model unit.
    • isClassTraceOn

      @Deprecated public static boolean isClassTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setClassTraceOn

      @Deprecated public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.