S
- The viewpublic class TLcdViewBasedTerrainElevationProvider<S extends ILcdView & ILcdLayered> extends ALcdRasterTerrainElevationProvider
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.
Constructor and Description |
---|
TLcdViewBasedTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider)
Constructs a new view based terrain elevation provider which is based on an
ALcdModelBasedTerrainElevationProvider . |
TLcdViewBasedTerrainElevationProvider(S aView,
ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider)
Constructs a new view based terrain elevation provider which is based on an
ALcdModelBasedTerrainElevationProvider . |
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 . |
int |
getMaximumValidRasterValue()
Returns the maximal raster value that is accepted when retrieving elevation
data.
|
int |
getMinimumValidRasterValue()
Returns the minimal raster value that is accepted when retrieving elevation
data.
|
double |
getOutOfRasterBoundsValue()
Returns the value that will be returned if no elevation can be found for the queried
point.
|
ILcdGeoReference |
getPreferredReference()
Returns the preferred reference for this terrain elevation provider.
|
ALcdModelBasedTerrainElevationProvider |
getTerrainElevationProvider()
Returns the internal terrain elevation provider to which retrieving terrain elevations is
delegated.
|
ILcdFilter |
getTerrainModelFilter()
Returns the
ILcdFilter for terrain models. |
double |
getUnknownElevation()
Returns the value that will be returned when the elevation is unknown.
|
S |
getView()
Returns the view containing the layers.
|
boolean |
isUseOnlyVisibleLayers()
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 value
aRasterValue 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 the
ILcdFilter 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 |
setView(S aView)
Set the view containing the raster layers.
|
retrieveAltitudeAt
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 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.
aTerrainElevationProvider
- The provider used to retrieve the actual elevation.setTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider)
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.
aView
- The view containing the layers.aTerrainElevationProvider
- The provider used to retrieve the actual elevation.setTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider)
public double retrieveElevationAt(ILcdPoint aModelPoint, ILcdGeoReference aReference)
ALcdTerrainElevationProvider
ALcdTerrainElevationProvider.getAltitudeDescriptor()
). Keep in mind that Double.NaN
,
Double.NEGATIVE_INFINITY
and Double.POSITIVE_INFINITY
can
also be used as special values.retrieveElevationAt
in class ALcdTerrainElevationProvider
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.public ILcdGeoReference getPreferredReference()
ALcdTerrainElevationProvider
ALcdTerrainElevationProvider.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
getPreferredReference
in class ALcdTerrainElevationProvider
null
can be returned if no preferred reference is available.ALcdTerrainElevationProvider.retrieveElevationAt(ILcdPoint,ILcdGeoReference)
public int getMaximumValidRasterValue()
ALcdRasterTerrainElevationProvider
getMaximumValidRasterValue
in class ALcdRasterTerrainElevationProvider
ALcdRasterTerrainElevationProvider.setMaximumValidRasterValue(int)
public int getMinimumValidRasterValue()
ALcdRasterTerrainElevationProvider
getMinimumValidRasterValue
in class ALcdRasterTerrainElevationProvider
ALcdRasterTerrainElevationProvider.setMinimumValidRasterValue(int)
public double getOutOfRasterBoundsValue()
ALcdRasterTerrainElevationProvider
getOutOfRasterBoundsValue
in class ALcdRasterTerrainElevationProvider
ALcdRasterTerrainElevationProvider.setOutOfRasterBoundsValue(double)
public double getUnknownElevation()
ALcdRasterTerrainElevationProvider
getUnknownElevation
in class ALcdRasterTerrainElevationProvider
ALcdRasterTerrainElevationProvider.setUnknownElevation(double)
public boolean isValidRasterValue(int aRasterValue)
ALcdRasterTerrainElevationProvider
aRasterValue
lies within
the interval [ getMinimumValidRasterValue() , getMaximumValidRasterValue() ].isValidRasterValue
in class ALcdRasterTerrainElevationProvider
aRasterValue
- the raster value to check.public void setMaximumValidRasterValue(int aMaximumValidRasterValue)
ALcdRasterTerrainElevationProvider
setMaximumValidRasterValue
in class ALcdRasterTerrainElevationProvider
aMaximumValidRasterValue
- the maximum valid raster value.ALcdRasterTerrainElevationProvider.getMaximumValidRasterValue()
public void setMinimumValidRasterValue(int aMinimumValidRasterValue)
ALcdRasterTerrainElevationProvider
setMinimumValidRasterValue
in class ALcdRasterTerrainElevationProvider
aMinimumValidRasterValue
- the minimum valid raster value.ALcdRasterTerrainElevationProvider.getMinimumValidRasterValue()
public void setOutOfRasterBoundsValue(double aOutOfRasterBoundsValue)
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
.
setOutOfRasterBoundsValue
in class ALcdRasterTerrainElevationProvider
aOutOfRasterBoundsValue
- the value for points outside the raster bounds.ALcdRasterTerrainElevationProvider.getOutOfRasterBoundsValue()
public void setUnknownElevation(double aUnknownElevation)
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
.
setUnknownElevation
in class ALcdRasterTerrainElevationProvider
aUnknownElevation
- the value for data outside the valid raster interval.ALcdRasterTerrainElevationProvider.getUnknownElevation()
public TLcdAltitudeDescriptor getAltitudeDescriptor()
ILcdAltitudeProvider
getAltitudeDescriptor
in interface ILcdAltitudeProvider
getAltitudeDescriptor
in class ALcdTerrainElevationProvider
public TLcdCoverageAltitudeMode getAltitudeMode()
ALcdTerrainElevationProvider
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
getAltitudeMode
in class ALcdTerrainElevationProvider
TLcdCoverageAltitudeMode.ABOVE_GEOID
.public boolean isValidElevation(double aElevation)
ALcdTerrainElevationProvider
Determines whether the given elevation is valid. This implementation returns false
if the elevation is a special value according to the altitude descriptor.
isValidElevation
in class ALcdTerrainElevationProvider
aElevation
- the elevation to check.true
if the elevation is valid, false
otherwise.public S getView()
setView(com.luciad.view.ILcdView)
public void setView(S aView)
aView
- The view containing the raster layers.getView()
public ILcdFilter getTerrainModelFilter()
ILcdFilter
for terrain models.ILcdFilter
for terrain models.setTerrainModelFilter(ILcdFilter)
public void setTerrainModelFilter(ILcdFilter aTerrainModelFilter)
ILcdFilter
for terrain models. This filter should only pass models that are
relevant for terrain information.aTerrainModelFilter
- The ILcdFilter
for terrain models.getTerrainModelFilter()
public ALcdModelBasedTerrainElevationProvider getTerrainElevationProvider()
setTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider)
public void setTerrainElevationProvider(ALcdModelBasedTerrainElevationProvider aTerrainElevationProvider)
aTerrainElevationProvider
- The internal terrain elevation provider.getTerrainElevationProvider()
public boolean isUseOnlyVisibleLayers()
true
if only visible layers are taken into account, false
when all layers are taken into account.setUseOnlyVisibleLayers(boolean)
public void setUseOnlyVisibleLayers(boolean aUseOnlyVisibleLayers)
aUseOnlyVisibleLayers
- If true
, only visible layers are taken into account
If false
, all layers are taken into account.isUseOnlyVisibleLayers()