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
ConstructorsConstructorDescriptionTLcdViewBasedTerrainElevationProvider(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.intReturns the maximal raster value that is accepted when retrieving elevation data.intReturns the minimal raster value that is accepted when retrieving elevation data.doubleReturns 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 theILcdFilterfor terrain models.doubleReturns the value that will be returned when the elevation is unknown.getView()Returns the view containing the layers.booleanReturns whether all layers are taken into account or only those that are visible.booleanisValidElevation(double aElevation) Determines whether the given elevation is valid.booleanisValidRasterValue(int aRasterValue) Determines whether the given raster valueaRasterValuelies within the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ].doubleretrieveElevationAt(ILcdPoint aModelPoint, ILcdGeoReference aReference) Returns the elevation for a given location, defined in meters above the geoid from the given location reference.voidsetMaximumValidRasterValue(int aMaximumValidRasterValue) Sets the maximal raster value that will be accepted when retrieving elevation data.voidsetMinimumValidRasterValue(int aMinimumValidRasterValue) Sets the minimal raster value that will be accepted when retrieving elevation data.voidsetOutOfRasterBoundsValue(double aOutOfRasterBoundsValue) Sets the value that will be returned if no elevation can be found for the queried point.voidsetTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider) Set the terrain elevation provider to which retrieving terrain elevations is delegated.voidsetTerrainModelFilter(ILcdFilter aTerrainModelFilter) Set theILcdFilterfor terrain models.voidsetUnknownElevation(double aUnknownElevation) Sets the value that will be returned when the elevation is unknown.voidsetUseOnlyVisibleLayers(boolean aUseOnlyVisibleLayers) Set whether all layers should be taken into account or only those that are visible.voidSet 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:ALcdTerrainElevationProviderReturns 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.- Specified by:
retrieveElevationAtin 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:ALcdTerrainElevationProviderReturns 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 returnnullif no preferred reference is available.- Specified by:
getPreferredReferencein interfaceILcdAltitudeProvider- Overrides:
getPreferredReferencein classALcdTerrainElevationProvider- Returns:
- the preferred reference of this terrain elevation provider. Note that
nullcan be returned if no preferred reference is available. - See Also:
-
getMaximumValidRasterValue
public int getMaximumValidRasterValue()Description copied from class:ALcdRasterTerrainElevationProviderReturns the maximal raster value that is accepted when retrieving elevation data. If a larger value is found, the unknown elevation value is used.- Overrides:
getMaximumValidRasterValuein classALcdRasterTerrainElevationProvider- Returns:
- the maximum valid raster value.
- See Also:
-
getMinimumValidRasterValue
public int getMinimumValidRasterValue()Description copied from class:ALcdRasterTerrainElevationProviderReturns the minimal raster value that is accepted when retrieving elevation data. If a smaller value is found, the unknown elevation value is used.- Overrides:
getMinimumValidRasterValuein classALcdRasterTerrainElevationProvider- Returns:
- the minimum valid raster value.
- See Also:
-
getOutOfRasterBoundsValue
public double getOutOfRasterBoundsValue()Description copied from class:ALcdRasterTerrainElevationProviderReturns 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:
getOutOfRasterBoundsValuein classALcdRasterTerrainElevationProvider- Returns:
- the value for points outside the raster bounds.
- See Also:
-
getUnknownElevation
public double getUnknownElevation()Description copied from class:ALcdRasterTerrainElevationProviderReturns the value that will be returned when the elevation is unknown.- Overrides:
getUnknownElevationin 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:ALcdRasterTerrainElevationProviderDetermines whether the given raster valueaRasterValuelies within the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ].- Overrides:
isValidRasterValuein 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:ALcdRasterTerrainElevationProviderSets the maximal raster value that will be accepted when retrieving elevation data.- Overrides:
setMaximumValidRasterValuein classALcdRasterTerrainElevationProvider- Parameters:
aMaximumValidRasterValue- the maximum valid raster value.- See Also:
-
setMinimumValidRasterValue
public void setMinimumValidRasterValue(int aMinimumValidRasterValue) Description copied from class:ALcdRasterTerrainElevationProviderSets the minimal raster value that will be accepted when retrieving elevation data.- Overrides:
setMinimumValidRasterValuein classALcdRasterTerrainElevationProvider- Parameters:
aMinimumValidRasterValue- the minimum valid raster value.- See Also:
-
setOutOfRasterBoundsValue
public void setOutOfRasterBoundsValue(double aOutOfRasterBoundsValue) Description copied from class:ALcdRasterTerrainElevationProviderSets 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:
setOutOfRasterBoundsValuein classALcdRasterTerrainElevationProvider- Parameters:
aOutOfRasterBoundsValue- the value for points outside the raster bounds.- See Also:
-
setUnknownElevation
public void setUnknownElevation(double aUnknownElevation) Description copied from class:ALcdRasterTerrainElevationProviderSets 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:
setUnknownElevationin classALcdRasterTerrainElevationProvider- Parameters:
aUnknownElevation- the value for data outside the valid raster interval.- See Also:
-
getAltitudeDescriptor
Description copied from interface:ILcdAltitudeProviderReturns the descriptor which describes how to interpret the altitude values.- Specified by:
getAltitudeDescriptorin interfaceILcdAltitudeProvider- Overrides:
getAltitudeDescriptorin classALcdTerrainElevationProvider- Returns:
- the descriptor which describes how to interpret the altitude values.
-
getAltitudeMode
Description copied from class:ALcdTerrainElevationProviderReturnsTLcdCoverageAltitudeMode.ABOVE_GEOID. All altitudes returned by this provider should be interpreted as defined above the geoid of the specified location reference.- Specified by:
getAltitudeModein interfaceILcdAltitudeProvider- Overrides:
getAltitudeModein classALcdTerrainElevationProvider- Returns:
TLcdCoverageAltitudeMode.ABOVE_GEOID.
-
isValidElevation
public boolean isValidElevation(double aElevation) Description copied from class:ALcdTerrainElevationProviderDetermines whether the given elevation is valid. This implementation returns
falseif the elevation is a special value according to the altitude descriptor.- Overrides:
isValidElevationin classALcdTerrainElevationProvider- Parameters:
aElevation- the elevation to check.- Returns:
trueif the elevation is valid,falseotherwise.
-
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 theILcdFilterfor terrain models.- Returns:
- the
ILcdFilterfor terrain models. - See Also:
-
setTerrainModelFilter
Set theILcdFilterfor terrain models. This filter should only pass models that are relevant for terrain information.- Parameters:
aTerrainModelFilter- TheILcdFilterfor 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:
trueif only visible layers are taken into account,falsewhen 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:
-