public class TLcdEarthTileSetElevationProvider extends ALcdEarthTerrainElevationProvider implements ILcdBounded
Constructor and Description |
---|
TLcdEarthTileSetElevationProvider(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.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the tile cache.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
int |
getCacheSize()
Returns the maximum number of tiles that are cached.
|
ILcdEarthTileSetCoverage |
getElevationCoverage()
Returns the coverage in the elevation tileset that contains the elevation data.
|
double |
getElevationOffset() |
double |
getElevationScale() |
ILcdEarthTileSet |
getElevationTileSet()
Returns the tileset that contains the elevation data.
|
ILcdExceptionHandler |
getExceptionHandler()
Returns the exception handler that is used to handle exceptions that occur during tile
retrieval.
|
int |
getMaxSynchronousLevel()
Returns the maximum level at which tiles will be requested synchronously.
|
int |
getMaxTileLevel()
Returns that maximum level at which tiles are retrieved.
|
ILcdGeoReference |
getPreferredReference()
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 |
isForceAsynchronousTileRequests()
Returns whether all tile requests are be forced to happen asynchronously.
|
boolean |
isInterpolateData()
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.
|
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet)
aElevationTileSet
- The elevation tileset.IllegalArgumentException
- If the given tileset does not have a valid elevation
coverage.isElevationTileSet(com.luciad.earth.tileset.ILcdEarthTileSet)
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdGeoReference aTileSetReference)
aElevationTileSet
- The elevation tileset.aTileSetReference
- The reference in which the tile set's bounds and tile pyramid are
definedIllegalArgumentException
- If the given tileset does not have a valid elevation
coverage.isElevationTileSet(com.luciad.earth.tileset.ILcdEarthTileSet)
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, ILcdGeoReference aTileSetReference)
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
definedIllegalArgumentException
- If the given tileset does not have a valid elevation
coverage.isElevationTileSet(com.luciad.earth.tileset.ILcdEarthTileSet)
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize)
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.IllegalArgumentException
- If the given tileset does not have a valid elevation
coverage.isElevationTileSet(com.luciad.earth.tileset.ILcdEarthTileSet)
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference)
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
definedIllegalArgumentException
- If the given tileset does not have a valid elevation
coverage.isElevationTileSet(com.luciad.earth.tileset.ILcdEarthTileSet)
public TLcdEarthTileSetElevationProvider(ILcdEarthTileSet aElevationTileSet, ILcdEarthTileSetCoverage aElevationCoverage, double aElevationScale, double aElevationOffset, int aCacheSize, ILcdGeoReference aTileSetReference)
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
definedIllegalArgumentException
- If the given tileset coverage does not contains an elevation
coverage.isElevationCoverage(com.luciad.earth.tileset.ILcdEarthTileSet, com.luciad.earth.tileset.ILcdEarthTileSetCoverage)
public static boolean isElevationTileSet(ILcdEarthTileSet aTileSet)
aTileSet
- the tileset to test.isElevationCoverage(com.luciad.earth.tileset.ILcdEarthTileSet, com.luciad.earth.tileset.ILcdEarthTileSetCoverage)
public static boolean isElevationCoverage(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage)
aTileSet
- the tilesetaCoverage
- the coverage in aTileSet
aCoverage
contains elevation data.public ILcdEarthTileSet getElevationTileSet()
public ILcdEarthTileSetCoverage getElevationCoverage()
public int getMaxTileLevel()
public void setMaxTileLevel(int aMaxLevel)
aMaxLevel
- The new maximum level.IllegalArgumentException
- if aMaxLevel
is negative or greater than the
maximum level of the elevation tileset.getMaxTileLevel()
public boolean isForceAsynchronousTileRequests()
getMaxSynchronousLevel()
.
In general this setting should be enabled if the callers of the retrieveElevationAt(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.true
if all tile requests are be forced to happen asynchronously,
false
if synchronous tile requests are allowed.getMaxSynchronousLevel()
public void setForceAsynchronousTileRequests(boolean aForceAsynchronous)
aForceAsynchronous
- true
if all tile requests should happen asynchronously,
false
if synchronous tile requests are allowed.isForceAsynchronousTileRequests()
public int getMaxSynchronousLevel()
isForceAsynchronousTileRequests()
,getMaxTileLevel()
,
isForceAsynchronousTileRequests()
,
retrieveElevationAt(com.luciad.shape.ILcdPoint, com.luciad.reference.ILcdGeoReference)
public void setMaxSynchronousLevel(int aMaxSynchronousLevel)
aMaxSynchronousLevel
- The maximum level at which tiles are requested synchronously or -1
to always request tiles synchronously.IllegalArgumentException
- if the aMaxSynchronousLevel
is smaller than -1 or
greater than the maximum level of the elevation tileset.getMaxSynchronousLevel()
public double getElevationScale()
public void setElevationScale(double aScale)
aScale
- The new elevation scale.public double getElevationOffset()
public void setElevationOffset(double aOffset)
aOffset
- The new elevation offset.public int getCacheSize()
public void setCacheSize(int aSize)
aSize
- the maximum number of tiles that should be cached.IllegalArgumentException
- if aSize
is negative.public void clearCache()
public ILcdExceptionHandler getExceptionHandler()
public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
aExceptionHandler
- the exception handlerpublic boolean isInterpolateData()
true
if the elevation data is interpolatedpublic void setInterpolateData(boolean aInterpolateData)
true
.aInterpolateData
- true
if the elevation data should be interpolatedpublic 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 double retrieveElevationAt(ILcdPoint aPoint, ILcdGeoReference aGeoReference, 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.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 retrievedpublic ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
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
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.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
ALcdEarthTerrainElevationProvider.retrieveElevationAt(ILcdPoint, ILcdGeoReference)