Class TLcdEarthCompositeTileSet
- All Implemented Interfaces:
ILcdEarthTileSet
,ILcdBounded
,ILcdDisposable
,AutoCloseable
ILcdEarthTileSet
objects into one new tileset. The tilesets from which coverages are taken
must all have the same tiling structure in order for them to be usable with
TLcdEarthCompositeTileSet
. The produceTile()
method
simply delegates to the tileset which originally contained the requested
coverage.
This tileset is thread-safe for tile reading if the registered tilesets are too.- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionTLcdEarthCompositeTileSet
(ILcdBounds aBounds, int aLevels) Constructs a newTLcdEarthCompositeTileSet
with the specified bounds and levelcount but a default number of rows and columns at level 0.TLcdEarthCompositeTileSet
(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns) Constructs a newTLcdEarthCompositeTileSet
with the specified tile structure. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelTile
(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext) Cancels any pending tile requests for the given parameters.boolean
canRegisterCoverage
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Returns whether a single coverage of a tileset can be registered.boolean
containsTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Returns true if the repository contains the specified tile.void
dispose()
Disposes each of the registered tilesets.Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.getRegisteredTileSet
(ILcdEarthTileSetCoverage aCoverage) Returns the tileset that is currently registered with a coverage.getTileSetCoverage
(int aIndex) Returns the coverage at the specified index.int
Returns the number of coverages this tileset contains.boolean
isCoverageRegistered
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Returns whether a coverage of a tileset is currently registered.boolean
isFormatSupported
(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat) Returns true only for the coverage's native format.boolean
isGeoReferenceSupported
(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Returns true only for the coverage's native georeference.void
produceTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Produces the requested tile, and invoke the supplied callback when done.produceTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, Object aContext) Gets a tile from the repository.void
registerCoverage
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Registers a single coverage of a tileset.void
registerTileSet
(ILcdEarthTileSet aTileSet) Registers all coverages of a tileset.boolean
unregisterCoverage
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Unregisters a single coverage of a tileset if it is currently registered.boolean
unregisterTileSet
(ILcdEarthTileSet aTileSet) Unregisters all coverages of a tileset.void
updateTile
(ALcdEarthTile aTile, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Produces an updated version of the given tile, if necessary.updateTile
(ALcdEarthTile aEarthTile, Object aContext) Returns an updated version of the specified tile.Methods inherited from class com.luciad.earth.tileset.ALcdEarthTileSet
containsTileSetCoverage, getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCount, getTileSetCoverage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdEarthCompositeTileSet
Constructs a newTLcdEarthCompositeTileSet
with the specified bounds and levelcount but a default number of rows and columns at level 0.- Parameters:
aBounds
- the bounds of the tileset.aLevels
- the number of levels.
-
TLcdEarthCompositeTileSet
public TLcdEarthCompositeTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns) Constructs a newTLcdEarthCompositeTileSet
with the specified tile structure.- Parameters:
aBounds
- the bounds of the tileset.aLevels
- the number of levels.aLevel0Rows
- the number of tile rows at level 0.aLevel0Columns
- the number of tile columns at level 0.
-
-
Method Details
-
registerTileSet
Registers all coverages of a tileset.- Parameters:
aTileSet
- A tileset with a proper configuration (e.g. bounds, levels, tile counts).- Throws:
IllegalArgumentException
- if the specified tileset does not have the same tile structure as this tileset or one of its coverages is already registered.
-
registerCoverage
Registers a single coverage of a tileset.- Parameters:
aTileSet
- A tileset with a proper configuration.aCoverage
- A coverage in the given tileset.- Throws:
IllegalArgumentException
- if the specified tileset does not have the same tile structure as this tileset or the coverage is already registered.NullPointerException
- if the specified coverage isnull
-
canRegisterCoverage
Returns whether a single coverage of a tileset can be registered.- Parameters:
aTileSet
- A tileset with a proper configuration.aCoverage
- A coverage in the given tileset.- Returns:
- true if the specified tileset does has the same tile structure and this tileset and coverage are not yet registered; false otherwise.
- See Also:
-
unregisterTileSet
Unregisters all coverages of a tileset.- Parameters:
aTileSet
- A tileset.- Returns:
- true if at least one coverage of the tileset was registered; false otherwise.
-
unregisterCoverage
Unregisters a single coverage of a tileset if it is currently registered.- Parameters:
aTileSet
- A tileset.aCoverage
- A coverage in the given tileset.- Returns:
- true if the coverage was registered; false otherwise.
-
isCoverageRegistered
Returns whether a coverage of a tileset is currently registered.- Parameters:
aTileSet
- A tileset.aCoverage
- A coverage in the given tileset.- Returns:
- true if the coverage is registered; false otherwise.
-
getRegisteredTileSet
Returns the tileset that is currently registered with a coverage.- Parameters:
aCoverage
- A coverage in this tileset.- Returns:
- the tileset that is registered with the coverage or
null
if the specified coverage is not of this tileset.
-
produceTile
public void produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSet
Produces the requested tile, and invoke the supplied callback when done. The resulting tile is passed to the call back'stileAvailable()
method. If the tile cannot be produced for some reason, the methodtileNotAvailable()
should be called instead.If the tileset supports it and
aMode
isTLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS
, the tile request may be executed asynchronously. However, the callback must be invoked at some point in time, unless thecancelTile()
method is used to cancel the tile request before it is executed. IfaMode
isTLcdEarthTileOperationMode.FORCE_SYNCHRONOUS
, the request must be executed synchronously and the callback must be invoked beforeproduceTile()
returns.Tiles may be requested in reference systems other than the native geo reference of the underlying data, provided that the
isGeoReferenceSupported()
method returns true for the requested reference. If this is not the case, the tileset should calltileNotAvailable()
. If the tileset callstileAvailable()
, the geo reference of the resulting tile must be equal toaGeoReference
, and the tile's bounds must likewise be expressed in this reference.Similarly, tiles may be requested in different data formats, as described by
TLcdEarthTileFormat
. The format determines the type of the data object that will be contained in the requested tile. To check if a format is supported, useisFormatSupported()
. If the specified format is not supported, the tileset should calltileNotAvailable()
.The context parameter may be used to pass application-specific data into the tileset. If it is not needed, its value may be
null
.- Parameters:
aCoverage
- the coverage from which the tile is requestedaLevel
- the level from which the tile is requestedaTileX
- the column index of the requested tileaTileY
- the row index of the requested tileaGeoReference
- the reference system in which the tile should be returnedaFormat
- the desired format of the tile's dataaMode
- controls the synchronous or asynchronous behaviour of the tilesetaCallback
- will be invoked when the tile is available to be usedaContext
- application-specific data to be used by the tileset, if any
-
produceTile
public ALcdEarthTile produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, Object aContext) throws IOException Description copied from interface:ILcdEarthTileSet
Gets a tile from the repository.- Specified by:
produceTile
in interfaceILcdEarthTileSet
- Overrides:
produceTile
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage from which to query a tileaLevel
- the detail level for which to query a tileaX
- the column index at which to query a tileaY
- the row index at which to query a tileaGeoReference
- the georeference of the requested tileaFormat
- the format of the requested tileaContext
- application-specific data to be used by the tileset, if any- Returns:
- the requested tile, or null if the repository does not contain this tile
- Throws:
IOException
- if the tile cannot be produced
-
updateTile
public void updateTile(ALcdEarthTile aTile, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSet
Produces an updated version of the given tile, if necessary. Produces the same tile if the given tile is up to date.- Specified by:
updateTile
in interfaceILcdEarthTileSet
- Overrides:
updateTile
in classALcdEarthTileSet
- Parameters:
aTile
- tile to checkaMode
- controls the synchronous or asynchronous behaviour of the tilesetaCallback
- will be invoked when the tile is available to be usedaContext
- application-specific data to be used by the tileset, if any
-
updateTile
Description copied from interface:ILcdEarthTileSet
Returns an updated version of the specified tile.- Specified by:
updateTile
in interfaceILcdEarthTileSet
- Overrides:
updateTile
in classALcdEarthTileSet
- Parameters:
aEarthTile
- the tile to checkaContext
- application-specific data to be used by the tileset, if any- Returns:
- the tile itself or a new, updated version
- Throws:
IOException
- if the tile cannot be updated
-
cancelTile
public void cancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSet
Cancels any pending tile requests for the given parameters. This method is only meaningful in tilesets that support the asynchronous operation mode. IfcancelTile()
is called, the tileset is no longer required to invoke theILcdEarthTileSetCallback
for the tile in question. The tileset is not obligated to honor thecancelTile()
request, but ifcancelTile()
is not called, then it is required to invoke theILcdEarthTileSetCallback
at some point.- Specified by:
cancelTile
in interfaceILcdEarthTileSet
- Overrides:
cancelTile
in classALcdEarthTileSet
- Parameters:
aLevel
- the level from which the tile is requestedaTileX
- the column index of the requested tileaTileY
- the row index of the requested tileaCoverage
- the coverage from which the tile is requestedaGeoReference
- the reference system in which the tile is requestedaFormat
- the format in which the tile is requestedaCallback
- would be invoked when the tile would have been available to be usedaContext
- application-specific data to be used by the tileset, if any
-
containsTile
public boolean containsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Description copied from interface:ILcdEarthTileSet
Returns true if the repository contains the specified tile.- Specified by:
containsTile
in interfaceILcdEarthTileSet
- Overrides:
containsTile
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage from which to query a tileaLevel
- the detail level for which to query a tileaX
- the column index at which to query a tileaY
- the row index at which to query a tileaContext
- application-specific data to be used by the tileset, if any- Returns:
- true if the repository contains the requested tile
-
dispose
public void dispose()Disposes each of the registered tilesets.- Specified by:
dispose
in interfaceILcdDisposable
- Specified by:
dispose
in interfaceILcdEarthTileSet
- Overrides:
dispose
in classALcdEarthTileSet
-
getBounds
Description copied from interface:ILcdEarthTileSet
Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.- Returns:
- the bounds of this tile set
- See Also:
-
getTileSetCoverageCount
public int getTileSetCoverageCount()Description copied from interface:ILcdEarthTileSet
Returns the number of coverages this tileset contains.- Returns:
- the number of coverages this tileset contains
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSet
Returns the coverage at the specified index.- Parameters:
aIndex
- the index of the coverage to return- Returns:
- the requested
ILcdEarthTileSetCoverage
-
isGeoReferenceSupported
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Description copied from class:ALcdEarthTileSet
Returns true only for the coverage's native georeference.- Specified by:
isGeoReferenceSupported
in interfaceILcdEarthTileSet
- Overrides:
isGeoReferenceSupported
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage to check foraGeoReference
- the reference to check for- Returns:
- true if the given coverage can be queried with the given reference
-
isFormatSupported
Description copied from class:ALcdEarthTileSet
Returns true only for the coverage's native format.- Specified by:
isFormatSupported
in interfaceILcdEarthTileSet
- Overrides:
isFormatSupported
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage to check foraFormat
- the format to check for- Returns:
- true if the given coverage can be queried with the given format
-