Class TLcdEarthThreadSafeTileSet
- All Implemented Interfaces:
ILcdEarthTileSet,ILcdBounded,ILcdDisposable,AutoCloseable
- Direct Known Subclasses:
TLcdEarthThreadSafeEditableTileSet
- Since:
- 8.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext) This method should be overridden if theproduceTileand/orupdateTileis overridden and the new implementation calls the implementation of this class using different parameters than passed to it.booleancontainsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Returns true if the repository contains the specified tile.booleancontainsTileSetCoverage(String aCoverageName) Returns true if the repository contains a coverage with the specified name.voiddispose()This method releases all resources held by the repository, such as file locks, threads or server connections.Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.intReturns the number of available detail levels.longgetTileColumnCount(int aLevel) Returns the number of columns in the tile grid at the given level.longgetTileRowCount(int aLevel) Returns the number of rows in the tile grid at the given level.getTileSetCoverage(int aIndex) Returns the coverage at the specified index.getTileSetCoverage(String aCoverageName) Returns the tileset coverage with the specified name.intReturns the number of coverages this tileset contains.booleanisFormatSupported(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat) Returns true if the tileset can produce tiles for the given coverage in the given format.booleanisGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Returns true if the tileset can produce tiles for the given coverage in the given reference system.voidproduceTile(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.voidupdateTile(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.util.ALcdEarthTileSetWrapper
getDelegateTileSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdEarthThreadSafeTileSet
-
-
Method Details
-
cancelTile
public void cancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from class:ALcdEarthTileSetWrapperThis method should be overridden if theproduceTileand/orupdateTileis overridden and the new implementation calls the implementation of this class using different parameters than passed to it. If the produceTile is overridden assuper.produceTile( myCoverage, aLevel, aTileX, aTileY, aGeoReference, aFormat, aMode, new MyTileSetCallback( aCallback ), aContext );
this method should be overridden assuper.cancelTile( aLevel, aTileX, aTileY, myCoverage, aGeoReference, aFormat, new MyTileSetCallback( aCallback ), aContext );
whereMyTileSetCallbackinstances with the same delegate callback are equal.- Specified by:
cancelTilein interfaceILcdEarthTileSet- Overrides:
cancelTilein classALcdEarthTileSetWrapper- 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:ILcdEarthTileSetReturns true if the repository contains the specified tile.- Specified by:
containsTilein interfaceILcdEarthTileSet- Overrides:
containsTilein classALcdEarthTileSetWrapper- 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
-
containsTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns true if the repository contains a coverage with the specified name.- Specified by:
containsTileSetCoveragein interfaceILcdEarthTileSet- Overrides:
containsTileSetCoveragein classALcdEarthTileSetWrapper- Parameters:
aCoverageName- the name of the coverage to look for- Returns:
- true if the repository contains a coverage with the specified name, false otherwise
-
dispose
public void dispose()Description copied from interface:ILcdEarthTileSetThis method releases all resources held by the repository, such as file locks, threads or server connections.- Specified by:
disposein interfaceILcdDisposable- Specified by:
disposein interfaceILcdEarthTileSet- Overrides:
disposein classALcdEarthTileSetWrapper
-
getBounds
Description copied from interface:ILcdEarthTileSetReturns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.- Specified by:
getBoundsin interfaceILcdBounded- Specified by:
getBoundsin interfaceILcdEarthTileSet- Overrides:
getBoundsin classALcdEarthTileSetWrapper- Returns:
- the bounds of this tile set
- See Also:
-
getLevelCount
public int getLevelCount()Description copied from interface:ILcdEarthTileSetReturns the number of available detail levels. Level 0 is the coarsest level.- Specified by:
getLevelCountin interfaceILcdEarthTileSet- Overrides:
getLevelCountin classALcdEarthTileSetWrapper- Returns:
- the number of available detail levels
-
getTileColumnCount
public long getTileColumnCount(int aLevel) Description copied from interface:ILcdEarthTileSetReturns the number of columns in the tile grid at the given level. Each level should have twice the number of columns of the previous one.- Specified by:
getTileColumnCountin interfaceILcdEarthTileSet- Overrides:
getTileColumnCountin classALcdEarthTileSetWrapper- Parameters:
aLevel- the level to be queried- Returns:
- the number of tile columns on the specified level
-
getTileRowCount
public long getTileRowCount(int aLevel) Description copied from interface:ILcdEarthTileSetReturns the number of rows in the tile grid at the given level. Each level should have twice the number of rows of the previous one.- Specified by:
getTileRowCountin interfaceILcdEarthTileSet- Overrides:
getTileRowCountin classALcdEarthTileSetWrapper- Parameters:
aLevel- the level to be queried- Returns:
- the number of tile rows on the specified level
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns the tileset coverage with the specified name.- Specified by:
getTileSetCoveragein interfaceILcdEarthTileSet- Overrides:
getTileSetCoveragein classALcdEarthTileSetWrapper- Parameters:
aCoverageName- the name of the coverage to look for- Returns:
- the tileset coverage with the specified name
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns the coverage at the specified index.- Specified by:
getTileSetCoveragein interfaceILcdEarthTileSet- Overrides:
getTileSetCoveragein classALcdEarthTileSetWrapper- Parameters:
aIndex- the index of the coverage to return- Returns:
- the requested
ILcdEarthTileSetCoverage
-
getTileSetCoverageCount
public int getTileSetCoverageCount()Description copied from interface:ILcdEarthTileSetReturns the number of coverages this tileset contains.- Specified by:
getTileSetCoverageCountin interfaceILcdEarthTileSet- Overrides:
getTileSetCoverageCountin classALcdEarthTileSetWrapper- Returns:
- the number of coverages this tileset contains
-
isFormatSupported
Description copied from interface:ILcdEarthTileSetReturns true if the tileset can produce tiles for the given coverage in the given format. Note that any format other than the native format may result in reduced performance.This method must always return true for the native format of the coverage. If it returns true for any other format, then the tileset must be able to handle the format in question in its
produceTile()method.- Specified by:
isFormatSupportedin interfaceILcdEarthTileSet- Overrides:
isFormatSupportedin classALcdEarthTileSetWrapper- 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
-
isGeoReferenceSupported
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Description copied from interface:ILcdEarthTileSetReturns true if the tileset can produce tiles for the given coverage in the given reference system. Note that any reference other than the native reference may result in reduced performance.This method must always return true for the native reference of the coverage. If it returns true for any other georeference, then the tileset must be able to handle the georeference in question in its
produceTile()method.- Specified by:
isGeoReferenceSupportedin interfaceILcdEarthTileSet- Overrides:
isGeoReferenceSupportedin classALcdEarthTileSetWrapper- 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
-
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:ILcdEarthTileSetProduces 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
aModeisTLcdEarthTileOperationMode.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. IfaModeisTLcdEarthTileOperationMode.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.- Specified by:
produceTilein interfaceILcdEarthTileSet- Overrides:
produceTilein classALcdEarthTileSetWrapper- 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:ILcdEarthTileSetGets a tile from the repository.- Specified by:
produceTilein interfaceILcdEarthTileSet- Overrides:
produceTilein classALcdEarthTileSetWrapper- 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
Description copied from interface:ILcdEarthTileSetReturns an updated version of the specified tile.- Specified by:
updateTilein interfaceILcdEarthTileSet- Overrides:
updateTilein classALcdEarthTileSetWrapper- 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
-
updateTile
public void updateTile(ALcdEarthTile aTile, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSetProduces an updated version of the given tile, if necessary. Produces the same tile if the given tile is up to date.- Specified by:
updateTilein interfaceILcdEarthTileSet- Overrides:
updateTilein classALcdEarthTileSetWrapper- 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
-