public class TLcdEarthTerrainElevationProvider extends ALcdEarthTerrainElevationProvider
ALcdEarthTerrainElevationProvider
that can handle multiple models
with elevation data.
In most cases the more recent ILcdHeightProvider
and ILcdModelHeightProviderFactory
interfaces should be preferred over this class. The functionality of this class is equivalent
to using a TLcdEarthHeightProviderFactory
and
TLcdImageModelHeightProviderFactory
to create a height provider
for each model and combining those with a TLcdCompositeHeightProvider
.
This class is optimized for the case where all models
have the same model reference. If this is not the case, the elevation
provider still works but will do so with reduced performance due to the need
for additional transformations.
The order of the elevation model determines their relative importance for computing the result of
retrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference, double)
: the lower the index, the higher the importance. There is no
particular order within a single model but this elevation provider always uses the most-detailed
level in a ILcdMultilevelRaster
and the most-detailed level that is available in a
ILcdEarthTileSet
.
This class is thread-safe.ILcdModelHeightProviderFactory
,
ILcdHeightProvider
Constructor and Description |
---|
TLcdEarthTerrainElevationProvider()
Creates a new
TLcdEarthTerrainElevationProvider with no elevation models. |
TLcdEarthTerrainElevationProvider(Vector aElevationModels)
Creates a new
TLcdEarthTerrainElevationProvider with the specified elevation
models. |
Modifier and Type | Method and Description |
---|---|
void |
addElevationModel(ILcdModel aElevationModel)
Adds the specified elevation model at the end.
|
void |
addElevationModel(int aIndex,
ILcdModel aElevationModel)
Adds the specified elevation model at the specified index.
|
ILcdModel |
getElevationModel(int aIndex)
Returns the elevation model at the specified index.
|
int |
getElevationModelCount()
Returns the number of elevation models.
|
ILcdGeoReference |
getPreferredReference()
Returns the preferred reference for this elevation provider.
|
int |
indexOf(ILcdModel aModel)
Returns the index of the specified elevation model or -1 if it is not present.
|
boolean |
isSupportedElevationModel(ILcdModel aModel)
Returns whether a model contains elevation data that can be used.
|
ILcdModel |
removeElevationModel(int aIndex)
Removes the elevation model at the specified index.
|
double |
retrieveElevationAt(ILcdPoint aPoint,
ILcdGeoReference aGeoReference)
Returns the elevation for a given location, defined in meters above mean sea level.
|
double |
retrieveElevationAt(ILcdPoint aPoint,
ILcdGeoReference aPointReference,
double aDesiredResolution)
Returns the elevation for a given location, defined in meters above mean sea level.
|
public TLcdEarthTerrainElevationProvider()
TLcdEarthTerrainElevationProvider
with no elevation models.public TLcdEarthTerrainElevationProvider(Vector aElevationModels)
TLcdEarthTerrainElevationProvider
with the specified elevation
models.aElevationModels
- ILcdModel
objects containing elevation data.public boolean isSupportedElevationModel(ILcdModel aModel)
ILcdRaster
, ILcdMultilevelRaster
or ILcdEarthTileSet
elements.aModel
- the model that should be tested.aModel
contains supported elevation data.public int getElevationModelCount()
public void addElevationModel(ILcdModel aElevationModel)
aElevationModel
- the elevation model to add.IllegalArgumentException
- if the specified model is not supported (see isSupportedElevationModel(com.luciad.model.ILcdModel)
).public void addElevationModel(int aIndex, ILcdModel aElevationModel)
aIndex
- an index in [0,getElevationModelCount()
].aElevationModel
- the elevation model to add.IllegalArgumentException
- if the specified model is not supported (see isSupportedElevationModel(com.luciad.model.ILcdModel)
).public ILcdModel getElevationModel(int aIndex)
aIndex
- an index in [0,getElevationModelCount()
[.public ILcdModel removeElevationModel(int aIndex)
aIndex
- an index in [0,getElevationModelCount()
[.public int indexOf(ILcdModel aModel)
aModel
- the elevation model.getElevationModelCount()
[ or -1.public double retrieveElevationAt(ILcdPoint aPoint, ILcdGeoReference aPointReference, double aDesiredResolution)
ALcdEarthTerrainElevationProvider
aDesiredResolution
parameter can be used to indicate to the elevation provider what the desired resolution of the
elevation values should be. The value should be a distance measured in units of the point
reference. If an application wants to request elevations for a grid of points which are 10
units apart, for instance, it could pass a value of 10.0 in aDesiredResolution
.
The elevation provider could then optimize for this particular resolution, e.g. by choosing the
appropriate detail level from a multileveled elevation raster.
The default implementation of this method simply delegates to ALcdEarthTerrainElevationProvider.retrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference)
and
hence does not use the aDesiredResolution
parameter.retrieveElevationAt
in class ALcdEarthTerrainElevationProvider
aPoint
- The point indicating the location for which to retrieve the
elevation.aPointReference
- The reference in which the given location is defined.aDesiredResolution
- An indication of the spacing (in units of the point reference)
between sample points for which elevations are being retrievedpublic double retrieveElevationAt(ILcdPoint aPoint, ILcdGeoReference aGeoReference)
ALcdEarthTerrainElevationProvider
retrieveElevationAt
in class ALcdEarthTerrainElevationProvider
aPoint
- The point indicating the location for which to retrieve the elevation.aGeoReference
- The reference in which the given location is defined.public ILcdGeoReference getPreferredReference()
ALcdEarthTerrainElevationProvider
Returns the preferred reference for this elevation provider. This reference is the reference with
the best performance when used as a parameter in the method ALcdEarthTerrainElevationProvider.retrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference)
. It is
perfectly correct to use points with other references. It will be faster to use the preferred one.
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
, indicating that no preferred reference is available.
getPreferredReference
in class ALcdEarthTerrainElevationProvider
null
if no preferred reference is available.ALcdEarthTerrainElevationProvider.retrieveElevationAt(ILcdPoint, ILcdGeoReference)