public abstract class ALcdTerrainElevationProvider extends Object implements ILcdAltitudeProvider
Provides terrain elevation data. All terrain elevation analysis classes that require terrain
elevation data should retrieve the data through this implementation. Different strategies for
retrieving terrain data can then seamlessly be plugged into the terrain elevation analysis
classes by replacing the ALcdTerrainElevationProvider
implementation.
The altitude or elevation values, provided by implementations of this class, are defined in
meters above geoid. Special values should be interpreted as defined by the altitude
descriptor (from getAltitudeDescriptor()
). Keep in mind that Double.NaN
,
Double.NEGATIVE_INFINITY
and Double.POSITIVE_INFINITY
can also be
used as special values.
Modifier | Constructor and Description |
---|---|
protected |
ALcdTerrainElevationProvider()
Defines an
ILcdAltitudeProvider that returns terrain elevation values
above the geoid from the specified location reference. |
Modifier and Type | Method and Description |
---|---|
TLcdAltitudeDescriptor |
getAltitudeDescriptor()
Returns the descriptor which describes how to interpret the altitude values.
|
TLcdCoverageAltitudeMode |
getAltitudeMode()
Returns
TLcdCoverageAltitudeMode.ABOVE_GEOID . |
ILcdGeoReference |
getPreferredReference()
Returns the preferred reference for this terrain elevation provider.
|
boolean |
isValidElevation(double aElevation)
Determines whether the given elevation is valid.
|
double |
retrieveAltitudeAt(ILcdPoint aPoint,
ILcdGeoReference aPointReference)
Returns the altitude in meters for the specified point.
|
abstract double |
retrieveElevationAt(ILcdPoint aPoint,
ILcdGeoReference aPointReference)
Returns the elevation for a given location, defined in meters above the geoid
from the given location reference.
|
protected ALcdTerrainElevationProvider()
ILcdAltitudeProvider
that returns terrain elevation values
above the geoid from the specified location reference.public abstract double retrieveElevationAt(ILcdPoint aPoint, ILcdGeoReference aPointReference)
getAltitudeDescriptor()
). Keep in mind that Double.NaN
,
Double.NEGATIVE_INFINITY
and Double.POSITIVE_INFINITY
can
also be used as special values.aPoint
- The point indicating the location for which to retrieve the elevation.aPointReference
- 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.public double retrieveAltitudeAt(ILcdPoint aPoint, ILcdGeoReference aPointReference)
Returns the altitude in meters for the specified point. The representation of this value
is defined by the altitude mode (from ILcdAltitudeProvider.getAltitudeMode()
) and the altitude descriptor
(from ILcdAltitudeProvider.getAltitudeDescriptor()
).
If no altitude value can be found for the specified point, the provider should return a
value with an appropriate interpretation. For example, when a point is chosen outside the
bounds of the elevation raster data, the value corresponding to the interpretation OUTSIDE_RASTER_BOUNDS
can be returned.
This implementations calls the method retrieveElevationAt(ILcdPoint, ILcdGeoReference)
to retrieve the altitude value for the given location.
retrieveAltitudeAt
in interface ILcdAltitudeProvider
aPoint
- The location for which to retrieve the altitude.aPointReference
- The reference in which the point is defined.public ILcdGeoReference getPreferredReference()
retrieveElevationAt(ILcdPoint, ILcdGeoReference)
. It is perfectly correct to use points
with other references. It will be faster to use the preferred.
For performance reasons, the preferred reference should be the reference of the available
elevation data to minimize the number of point transformations. By default, this method
returns null
.
Keep in mind that this function can return null
if no preferred reference is
available.getPreferredReference
in interface ILcdAltitudeProvider
null
can be returned if no preferred reference is available.retrieveElevationAt(ILcdPoint,ILcdGeoReference)
public TLcdAltitudeDescriptor getAltitudeDescriptor()
ILcdAltitudeProvider
getAltitudeDescriptor
in interface ILcdAltitudeProvider
public TLcdCoverageAltitudeMode getAltitudeMode()
TLcdCoverageAltitudeMode.ABOVE_GEOID
. All altitudes returned by
this provider should be interpreted as defined above the geoid of the specified
location reference.getAltitudeMode
in interface ILcdAltitudeProvider
TLcdCoverageAltitudeMode.ABOVE_GEOID
.public boolean isValidElevation(double aElevation)
Determines whether the given elevation is valid. This implementation returns false
if the elevation is a special value according to the altitude descriptor.
aElevation
- the elevation to check.true
if the elevation is valid, false
otherwise.