Class TLcdViewBasedTerrainElevationProvider<S extends ILcdView & ILcdLayered>
- Type Parameters:
S
- The view
- All Implemented Interfaces:
ILcdAltitudeProvider
- Direct Known Subclasses:
TLcdGXYViewBasedTerrainElevationProvider
This mediator keeps track of terrain models in the ILcdView
and adds/removes
them to/from the specified model based terrain elevation provider. It provides the elevation
values from the view by extracting all models from it, and then asking its delegate
ALcdModelBasedTerrainElevationProvider
to provide the actual elevations.
Note that a view must be set using setView(ILcdView)
before
the mediator can add/remove terrain models to/from the model based elevation provider.
If no view is set, the model based elevation provider remains unchanged. The method
retrieveElevationAt(ILcdPoint, ILcdGeoReference)
shall probably return the
unknown elevation value for all specified points. This depends on the implementation
of the specified model based elevation provider.
- Since:
- 9.1
-
Constructor Summary
ConstructorDescriptionTLcdViewBasedTerrainElevationProvider
(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Constructs a new view based terrain elevation provider which is based on anALcdModelBasedTerrainElevationProvider
.TLcdViewBasedTerrainElevationProvider
(S aView, ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Constructs a new view based terrain elevation provider which is based on anALcdModelBasedTerrainElevationProvider
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the descriptor which describes how to interpret the altitude values.ReturnsTLcdCoverageAltitudeMode.ABOVE_GEOID
.int
Returns the maximal raster value that is accepted when retrieving elevation data.int
Returns the minimal raster value that is accepted when retrieving elevation data.double
Returns the value that will be returned if no elevation can be found for the queried point.Returns the preferred reference for this terrain elevation provider.Returns the internal terrain elevation provider to which retrieving terrain elevations is delegated.Returns theILcdFilter
for terrain models.double
Returns the value that will be returned when the elevation is unknown.getView()
Returns the view containing the layers.boolean
Returns whether all layers are taken into account or only those that are visible.boolean
isValidElevation
(double aElevation) Determines whether the given elevation is valid.boolean
isValidRasterValue
(int aRasterValue) Determines whether the given raster valueaRasterValue
lies within the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ].double
retrieveElevationAt
(ILcdPoint aModelPoint, ILcdGeoReference aReference) Returns the elevation for a given location, defined in meters above the geoid from the given location reference.void
setMaximumValidRasterValue
(int aMaximumValidRasterValue) Sets the maximal raster value that will be accepted when retrieving elevation data.void
setMinimumValidRasterValue
(int aMinimumValidRasterValue) Sets the minimal raster value that will be accepted when retrieving elevation data.void
setOutOfRasterBoundsValue
(double aOutOfRasterBoundsValue) Sets the value that will be returned if no elevation can be found for the queried point.void
setTerrainElevationProvider
(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Set the terrain elevation provider to which retrieving terrain elevations is delegated.void
setTerrainModelFilter
(ILcdFilter aTerrainModelFilter) Set theILcdFilter
for terrain models.void
setUnknownElevation
(double aUnknownElevation) Sets the value that will be returned when the elevation is unknown.void
setUseOnlyVisibleLayers
(boolean aUseOnlyVisibleLayers) Set whether all layers should be taken into account or only those that are visible.void
Set the view containing the raster layers.Methods inherited from class com.luciad.tea.ALcdTerrainElevationProvider
retrieveAltitudeAt
-
Constructor Details
-
TLcdViewBasedTerrainElevationProvider
public TLcdViewBasedTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Constructs a new view based terrain elevation provider which is based on an
ALcdModelBasedTerrainElevationProvider
. This model based elevation provider will be used to retrieve the actual elevation.Note that a view must be set using
setView(ILcdView)
before the mediator can add/remove terrain models to/from the model based elevation provider. If no view is set, the model based elevation provider remains unchanged. The methodretrieveElevationAt(ILcdPoint, ILcdGeoReference)
shall probably return the unknown elevation value for all specified points. This depends on the implementation of the specified model based elevation provider.- Parameters:
aTerrainElevationProvider
- The provider used to retrieve the actual elevation.- See Also:
-
TLcdViewBasedTerrainElevationProvider
public TLcdViewBasedTerrainElevationProvider(S aView, ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Constructs a new view based terrain elevation provider which is based on an
ALcdModelBasedTerrainElevationProvider
. The specified view provides the terrain models and the model based elevation provider provides the actual elevation.- Parameters:
aView
- The view containing the layers.aTerrainElevationProvider
- The provider used to retrieve the actual elevation.- See Also:
-
-
Method Details
-
retrieveElevationAt
Description copied from class:ALcdTerrainElevationProvider
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_INFINITY
andDouble.POSITIVE_INFINITY
can also be used as special values.- Specified by:
retrieveElevationAt
in classALcdTerrainElevationProvider
- Parameters:
aModelPoint
- The point indicating the location for which to retrieve the elevation.aReference
- 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.
-
getPreferredReference
Description copied from class:ALcdTerrainElevationProvider
Returns the preferred reference for this terrain elevation provider. This reference is the reference with the best performance when used as a parameter in the methodALcdTerrainElevationProvider.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 returnsnull
. Keep in mind that this function can returnnull
if no preferred reference is available.- Specified by:
getPreferredReference
in interfaceILcdAltitudeProvider
- Overrides:
getPreferredReference
in classALcdTerrainElevationProvider
- Returns:
- the preferred reference of this terrain elevation provider. Note that
null
can be returned if no preferred reference is available. - See Also:
-
getMaximumValidRasterValue
public int getMaximumValidRasterValue()Description copied from class:ALcdRasterTerrainElevationProvider
Returns the maximal raster value that is accepted when retrieving elevation data. If a larger value is found, the unknown elevation value is used.- Overrides:
getMaximumValidRasterValue
in classALcdRasterTerrainElevationProvider
- Returns:
- the maximum valid raster value.
- See Also:
-
getMinimumValidRasterValue
public int getMinimumValidRasterValue()Description copied from class:ALcdRasterTerrainElevationProvider
Returns the minimal raster value that is accepted when retrieving elevation data. If a smaller value is found, the unknown elevation value is used.- Overrides:
getMinimumValidRasterValue
in classALcdRasterTerrainElevationProvider
- Returns:
- the minimum valid raster value.
- See Also:
-
getOutOfRasterBoundsValue
public double getOutOfRasterBoundsValue()Description copied from class:ALcdRasterTerrainElevationProvider
Returns the value that will be returned if no elevation can be found for the queried point. This can happen if a point is chosen outside the bounds of the elevation raster data.- Overrides:
getOutOfRasterBoundsValue
in classALcdRasterTerrainElevationProvider
- Returns:
- the value for points outside the raster bounds.
- See Also:
-
getUnknownElevation
public double getUnknownElevation()Description copied from class:ALcdRasterTerrainElevationProvider
Returns the value that will be returned when the elevation is unknown.- Overrides:
getUnknownElevation
in classALcdRasterTerrainElevationProvider
- Returns:
- the value that will be returned when the elevation is unknown.
- See Also:
-
isValidRasterValue
public boolean isValidRasterValue(int aRasterValue) Description copied from class:ALcdRasterTerrainElevationProvider
Determines whether the given raster valueaRasterValue
lies within the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ].- Overrides:
isValidRasterValue
in classALcdRasterTerrainElevationProvider
- Parameters:
aRasterValue
- the raster value to check.- Returns:
- true if the raster value is valid, false otherwise.
-
setMaximumValidRasterValue
public void setMaximumValidRasterValue(int aMaximumValidRasterValue) Description copied from class:ALcdRasterTerrainElevationProvider
Sets the maximal raster value that will be accepted when retrieving elevation data.- Overrides:
setMaximumValidRasterValue
in classALcdRasterTerrainElevationProvider
- Parameters:
aMaximumValidRasterValue
- the maximum valid raster value.- See Also:
-
setMinimumValidRasterValue
public void setMinimumValidRasterValue(int aMinimumValidRasterValue) Description copied from class:ALcdRasterTerrainElevationProvider
Sets the minimal raster value that will be accepted when retrieving elevation data.- Overrides:
setMinimumValidRasterValue
in classALcdRasterTerrainElevationProvider
- Parameters:
aMinimumValidRasterValue
- the minimum valid raster value.- See Also:
-
setOutOfRasterBoundsValue
public void setOutOfRasterBoundsValue(double aOutOfRasterBoundsValue) Description copied from class:ALcdRasterTerrainElevationProvider
Sets the value that will be returned if no elevation can be found for the queried point. This can happen if a point is chosen outside the bounds of the elevation raster data. By default, this is set to
Double.NaN
.Note that the altitude descriptor of this instance will be updated if the given elevation value is not a special value yet. If it is, the altitude descriptor will remain unchanged. The property corresponds to the altitude interpretation
OUTSIDE_RASTER_BOUNDS
.- Overrides:
setOutOfRasterBoundsValue
in classALcdRasterTerrainElevationProvider
- Parameters:
aOutOfRasterBoundsValue
- the value for points outside the raster bounds.- See Also:
-
setUnknownElevation
public void setUnknownElevation(double aUnknownElevation) Description copied from class:ALcdRasterTerrainElevationProvider
Sets the value that will be returned when the elevation is unknown. A value is set to be unknown if the corresponding raster value lies outside the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ]. By default, this is set to
Double.NaN
.Note that the altitude descriptor of this instance will be updated if the given elevation value is not a special value yet. If it is, the altitude descriptor will remain unchanged. The property corresponds to the altitude interpretation
UNKNOWN_ELEVATION
.- Overrides:
setUnknownElevation
in classALcdRasterTerrainElevationProvider
- Parameters:
aUnknownElevation
- the value for data outside the valid raster interval.- See Also:
-
getAltitudeDescriptor
Description copied from interface:ILcdAltitudeProvider
Returns the descriptor which describes how to interpret the altitude values.- Specified by:
getAltitudeDescriptor
in interfaceILcdAltitudeProvider
- Overrides:
getAltitudeDescriptor
in classALcdTerrainElevationProvider
- Returns:
- the descriptor which describes how to interpret the altitude values.
-
getAltitudeMode
Description copied from class:ALcdTerrainElevationProvider
ReturnsTLcdCoverageAltitudeMode.ABOVE_GEOID
. All altitudes returned by this provider should be interpreted as defined above the geoid of the specified location reference.- Specified by:
getAltitudeMode
in interfaceILcdAltitudeProvider
- Overrides:
getAltitudeMode
in classALcdTerrainElevationProvider
- Returns:
TLcdCoverageAltitudeMode.ABOVE_GEOID
.
-
isValidElevation
public boolean isValidElevation(double aElevation) Description copied from class:ALcdTerrainElevationProvider
Determines whether the given elevation is valid. This implementation returns
false
if the elevation is a special value according to the altitude descriptor.- Overrides:
isValidElevation
in classALcdTerrainElevationProvider
- Parameters:
aElevation
- the elevation to check.- Returns:
true
if the elevation is valid,false
otherwise.
-
getView
Returns the view containing the layers.- Returns:
- the view containing the layers.
- See Also:
-
setView
Set the view containing the raster layers.- Parameters:
aView
- The view containing the raster layers.- See Also:
-
getTerrainModelFilter
Returns theILcdFilter
for terrain models.- Returns:
- the
ILcdFilter
for terrain models. - See Also:
-
setTerrainModelFilter
Set theILcdFilter
for terrain models. This filter should only pass models that are relevant for terrain information.- Parameters:
aTerrainModelFilter
- TheILcdFilter
for terrain models.- See Also:
-
getTerrainElevationProvider
Returns the internal terrain elevation provider to which retrieving terrain elevations is delegated.- Returns:
- the internal terrain elevation provider to which retrieving terrain elevations is delegated.
- See Also:
-
setTerrainElevationProvider
public void setTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Set the terrain elevation provider to which retrieving terrain elevations is delegated.- Parameters:
aTerrainElevationProvider
- The internal terrain elevation provider.- See Also:
-
isUseOnlyVisibleLayers
public boolean isUseOnlyVisibleLayers()Returns whether all layers are taken into account or only those that are visible.- Returns:
true
if only visible layers are taken into account,false
when all layers are taken into account.- See Also:
-
setUseOnlyVisibleLayers
public void setUseOnlyVisibleLayers(boolean aUseOnlyVisibleLayers) Set whether all layers should be taken into account or only those that are visible.- Parameters:
aUseOnlyVisibleLayers
- Iftrue
, only visible layers are taken into account Iffalse
, all layers are taken into account.- See Also:
-