Package com.luciad.tea
Class TLcdDensityBasedRasterElevationProvider
java.lang.Object
com.luciad.tea.ALcdTerrainElevationProvider
com.luciad.tea.ALcdRasterTerrainElevationProvider
com.luciad.tea.ALcdModelBasedTerrainElevationProvider
com.luciad.tea.TLcdDensityBasedRasterElevationProvider
- All Implemented Interfaces:
ILcdAltitudeProvider
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 Summary
ConstructorsConstructorDescriptionDefines anALcdModelBasedTerrainElevationProviderwhich retrieves elevation values from the raster with the pixel density closest to the desired pixel density. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a model to the list of models to be taken into account for retrieving elevation data.static doublecomputePixelDensityFromDistanceDelta(double aDistanceDelta, boolean aMeters) Computes a pixel density value from a given distance (pixel width).doubleGets the pixel density value.Gets the reference in which the pixel density is defined.static booleanDeprecated.This method has been deprecated.voidEmpty the list of models to be taken into account for retrieving elevation data.voidremoveModel(ILcdModel aModel) Remove a model from list set of models to be taken into account for retrieving elevation data.doubleretrieveElevationAt(ILcdPoint aModelPoint, ILcdGeoReference aModelPointReference) Returns the elevation for a given location, defined in meters above the geoid from the given location reference.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetPixelDensity(double aPixelDensity) Set the pixel density value.voidsetPixelDensityReference(ILcdGeoReference aPixelDensityReference) Set the reference in which the pixel density is defined.protected doubletransformPixelDensity(double aPixelDensity, ILcdGeoReference aSourceReference, ILcdGeoReference aDestinationReference) Transforms a pixel density in aSourceReference to a pixel density in aDestinationReference.Methods inherited from class com.luciad.tea.ALcdModelBasedTerrainElevationProvider
getModel, getModelCount, getPreferredReferenceMethods inherited from class com.luciad.tea.ALcdRasterTerrainElevationProvider
getMaximumValidRasterValue, getMinimumValidRasterValue, getOutOfRasterBoundsValue, getUnknownElevation, isValidRasterValue, setMaximumValidRasterValue, setMinimumValidRasterValue, setOutOfRasterBoundsValue, setUnknownElevationMethods inherited from class com.luciad.tea.ALcdTerrainElevationProvider
getAltitudeDescriptor, getAltitudeMode, isValidElevation, retrieveAltitudeAt
-
Constructor Details
-
TLcdDensityBasedRasterElevationProvider
public TLcdDensityBasedRasterElevationProvider()Defines anALcdModelBasedTerrainElevationProviderwhich retrieves elevation values from the raster with the pixel density closest to the desired pixel density.
-
-
Method Details
-
retrieveElevationAt
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 (fromALcdTerrainElevationProvider.getAltitudeDescriptor()). Keep in mind thatDouble.NaN,Double.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYcan 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:
retrieveElevationAtin classALcdTerrainElevationProvider- 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
Description copied from class:ALcdModelBasedTerrainElevationProviderAdd a model to the list of models to be taken into account for retrieving elevation data.- Overrides:
addModelin classALcdModelBasedTerrainElevationProvider- Parameters:
aModel- The model to be added.
-
removeModel
Description copied from class:ALcdModelBasedTerrainElevationProviderRemove a model from list set of models to be taken into account for retrieving elevation data.- Overrides:
removeModelin classALcdModelBasedTerrainElevationProvider- Parameters:
aModel- The model to be removed.
-
removeAllModels
public void removeAllModels()Description copied from class:ALcdModelBasedTerrainElevationProviderEmpty the list of models to be taken into account for retrieving elevation data.- Overrides:
removeAllModelsin classALcdModelBasedTerrainElevationProvider
-
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
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.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setClassTraceOn
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 istruethen 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.
-