Class TLcdEarthTileSetElevationProvider
- All Implemented Interfaces:
ILcdBounded
- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionTLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet) Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously.TLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously.TLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously.TLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously.TLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, ILcdGeoReference aTileSetReference) Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously.TLcdEarthTileSetElevationProvider
(ILcdEarthTileSet aElevationTileSet, ILcdGeoReference aTileSetReference) Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the tile cache.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.int
Returns the maximum number of tiles that are cached.Returns the coverage in the elevation tileset that contains the elevation data.double
double
Returns the tileset that contains the elevation data.Returns the exception handler that is used to handle exceptions that occur during tile retrieval.int
Returns the maximum level at which tiles will be requested synchronously.int
Returns that maximum level at which tiles are retrieved.Returns the preferred reference for this elevation provider.static boolean
isElevationCoverage
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Returns whether the coverage in the specified coverage contains elevation data.static boolean
isElevationTileSet
(ILcdEarthTileSet aTileSet) Returns whether the specified tileset is an elevation tileset.boolean
Returns whether all tile requests are be forced to happen asynchronously.boolean
Returns whether the elevation data is interpolated or not.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 aGeoReference, double aDesiredResolution) Returns the elevation for a given location, defined in meters above mean sea level.void
setCacheSize
(int aSize) Sets the maximum number of tiles that should be cached.void
setElevationOffset
(double aOffset) Sets the elevation offset to the given value.void
setElevationScale
(double aScale) Sets the elevation scale to the given value.void
setExceptionHandler
(ILcdExceptionHandler aExceptionHandler) Sets the exception handler that is used to handle exceptions that occur during tile retrieval.void
setForceAsynchronousTileRequests
(boolean aForceAsynchronous) Sets whether all tile requests should be forced to happen asynchronously.void
setInterpolateData
(boolean aInterpolateData) Returns whether the elevation data should be interpolated or not.void
setMaxSynchronousLevel
(int aMaxSynchronousLevel) Sets the maximum level at which tiles are requested synchronously.void
setMaxTileLevel
(int aMaxLevel) Sets the maximum tile level to the given value.
-
Constructor Details
-
TLcdEarthTileSetElevationProvider
Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously. It is assumed that the reference of the tileset is a geodetic reference.- Parameters:
aElevationTileSet
- The elevation tileset.- Throws:
IllegalArgumentException
- If the given tileset does not have a valid elevation coverage.- See Also:
-
TLcdEarthTileSetElevationProvider
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdGeoReference aTileSetReference) Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously.- Parameters:
aElevationTileSet
- The elevation tileset.aTileSetReference
- The reference in which the tile set's bounds and tile pyramid are defined- Throws:
IllegalArgumentException
- If the given tileset does not have a valid elevation coverage.- See Also:
-
TLcdEarthTileSetElevationProvider
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, ILcdGeoReference aTileSetReference) Creates a new elevation provider that does not scale the provided elevations and requests all tiles synchronously.- Parameters:
aElevationTileSet
- The elevation tileset.aElevationCoverage
- The coverage in the elevation tileset that contains the elevation data.aTileSetReference
- The reference in which the tileset's bounds and tile pyramid are defined- Throws:
IllegalArgumentException
- If the given tileset does not have a valid elevation coverage.- See Also:
-
TLcdEarthTileSetElevationProvider
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously. It is assumed that the reference of the tileset is a geodetic reference.- Parameters:
aElevationTileSet
- The elevation tileset.aElevationScale
- The scale to apply to the elevation data.aElevationOffset
- The offset to apply to the elevation data.aCacheSize
- The number of tiles that are cached.- Throws:
IllegalArgumentException
- If the given tileset does not have a valid elevation coverage.- See Also:
-
TLcdEarthTileSetElevationProvider
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously.- Parameters:
aElevationTileSet
- The elevation tileset.aElevationScale
- The scale to apply to the elevation data.aElevationOffset
- The offset to apply to the elevation data.aCacheSize
- The number of tiles that are cached.aTileSetReference
- The reference in which the tile set's bounds and tile pyramid are defined- Throws:
IllegalArgumentException
- If the given tileset does not have a valid elevation coverage.- See Also:
-
TLcdEarthTileSetElevationProvider
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference) Creates a new elevation provider that scales the provided elevations and requests all tiles synchronously.- Parameters:
aElevationTileSet
- The elevation tileset.aElevationCoverage
- The coverage in the elevation tileset that contains the elevation data.aElevationScale
- The scale to apply to the elevation data.aElevationOffset
- The offset to apply to the elevation data.aCacheSize
- The number of tiles that are cached.aTileSetReference
- The reference in which the tile set's bounds and tile pyramid are defined- Throws:
IllegalArgumentException
- If the given tileset coverage does not contains an elevation coverage.- See Also:
-
-
Method Details
-
isElevationTileSet
Returns whether the specified tileset is an elevation tileset. If this method returns true the tileset contains an elevation coverage.- Parameters:
aTileSet
- the tileset to test.- Returns:
- true if the specified tileset is an elevation tileset.
- See Also:
-
isElevationCoverage
public static boolean isElevationCoverage(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Returns whether the coverage in the specified coverage contains elevation data.- Parameters:
aTileSet
- the tilesetaCoverage
- the coverage inaTileSet
- Returns:
- true if
aCoverage
contains elevation data.
-
getElevationTileSet
Returns the tileset that contains the elevation data.- Returns:
- the elevation tileset.
-
getElevationCoverage
Returns the coverage in the elevation tileset that contains the elevation data.- Returns:
- the elevation coverage.
-
getMaxTileLevel
public int getMaxTileLevel()Returns that maximum level at which tiles are retrieved. Using a higher maximum level generally results in more accurate elevation values but reduces the performance due to a smaller cache hit rate (tiles at higher levels are smaller so the chance that two points are in the same tile reduces).- Returns:
- The maximum level at which tiles are retrieved.
-
setMaxTileLevel
public void setMaxTileLevel(int aMaxLevel) Sets the maximum tile level to the given value.- Parameters:
aMaxLevel
- The new maximum level.- Throws:
IllegalArgumentException
- ifaMaxLevel
is negative or greater than the maximum level of the elevation tileset.- See Also:
-
isForceAsynchronousTileRequests
public boolean isForceAsynchronousTileRequests()Returns whether all tile requests are be forced to happen asynchronously. Note that if forcing asynchronous tile requests is enabled, all tile requests will happen asynchronously, regardless of the value ofgetMaxSynchronousLevel()
. In general this setting should be enabled if the callers of theretrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference)
methods should never block (ex. for IO). This is for example the case if the elevations are retrieved from the Event Dispatch Thread.- Returns:
true
if all tile requests are be forced to happen asynchronously,false
if synchronous tile requests are allowed.- See Also:
-
setForceAsynchronousTileRequests
public void setForceAsynchronousTileRequests(boolean aForceAsynchronous) Sets whether all tile requests should be forced to happen asynchronously.- Parameters:
aForceAsynchronous
-true
if all tile requests should happen asynchronously,false
if synchronous tile requests are allowed.- See Also:
-
getMaxSynchronousLevel
public int getMaxSynchronousLevel()Returns the maximum level at which tiles will be requested synchronously. All data at higher levels will be requested asynchronously. So tiles can be requested asynchronously if the maximum synchronous level is smaller than the maximum tile level. Requesting tiles asynchronously improves the performance of the retrieve altitude methods but, because some tiles may or may not immediately be available, the returned altitudes can vary over time. Note that this settings can be overridden byisForceAsynchronousTileRequests()
,- Returns:
- The maximum level at which tiles are retrieved synchronously.
- See Also:
-
setMaxSynchronousLevel
public void setMaxSynchronousLevel(int aMaxSynchronousLevel) Sets the maximum level at which tiles are requested synchronously.- Parameters:
aMaxSynchronousLevel
- The maximum level at which tiles are requested synchronously or -1 to always request tiles synchronously.- Throws:
IllegalArgumentException
- if theaMaxSynchronousLevel
is smaller than -1 or greater than the maximum level of the elevation tileset.- See Also:
-
getElevationScale
public double getElevationScale()- Returns:
- The current elevation scale.
-
setElevationScale
public void setElevationScale(double aScale) Sets the elevation scale to the given value.- Parameters:
aScale
- The new elevation scale.
-
getElevationOffset
public double getElevationOffset()- Returns:
- The current elevation offset.
-
setElevationOffset
public void setElevationOffset(double aOffset) Sets the elevation offset to the given value.- Parameters:
aOffset
- The new elevation offset.
-
getCacheSize
public int getCacheSize()Returns the maximum number of tiles that are cached.- Returns:
- the maximum number of tiles that are cached.
-
setCacheSize
public void setCacheSize(int aSize) Sets the maximum number of tiles that should be cached.- Parameters:
aSize
- the maximum number of tiles that should be cached.- Throws:
IllegalArgumentException
- ifaSize
is negative.
-
clearCache
public void clearCache()Clears the tile cache. -
getExceptionHandler
Returns the exception handler that is used to handle exceptions that occur during tile retrieval. The default exception handler simply writes a log entry.- Returns:
- the exception handler
-
setExceptionHandler
Sets the exception handler that is used to handle exceptions that occur during tile retrieval.- Parameters:
aExceptionHandler
- the exception handler
-
isInterpolateData
public boolean isInterpolateData()Returns whether the elevation data is interpolated or not.- Returns:
true
if the elevation data is interpolated
-
setInterpolateData
public void setInterpolateData(boolean aInterpolateData) Returns whether the elevation data should be interpolated or not. The default value istrue
.- Parameters:
aInterpolateData
-true
if the elevation data should be interpolated
-
retrieveElevationAt
Description copied from class:ALcdEarthTerrainElevationProvider
Returns the elevation for a given location, defined in meters above mean sea level. If the elevation cannot be determined, this method returns NaN.- Specified by:
retrieveElevationAt
in classALcdEarthTerrainElevationProvider
- Parameters:
aPoint
- The point indicating the location for which to retrieve the elevation.aGeoReference
- The reference in which the given location is defined.- Returns:
- the elevation for a given location, defined in meters above mean sea level, or NaN when the elevation cannot be determined.
-
retrieveElevationAt
public double retrieveElevationAt(ILcdPoint aPoint, ILcdGeoReference aGeoReference, double aDesiredResolution) Description copied from class:ALcdEarthTerrainElevationProvider
Returns the elevation for a given location, defined in meters above mean sea level. If the elevation cannot be determined, this method returns NaN. TheaDesiredResolution
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 inaDesiredResolution
. 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 toALcdEarthTerrainElevationProvider.retrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference)
and hence does not use theaDesiredResolution
parameter.- Overrides:
retrieveElevationAt
in classALcdEarthTerrainElevationProvider
- Parameters:
aPoint
- The point indicating the location for which to retrieve the elevation.aGeoReference
- 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 retrieved- Returns:
- the elevation for a given location, defined in meters above mean sea level, or NaN when the elevation cannot be determined.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
getPreferredReference
Description copied from class: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.- Overrides:
getPreferredReference
in classALcdEarthTerrainElevationProvider
- Returns:
- the reference of the tile set.
- See Also:
-