Package com.luciad.earth.tileset
Class ALcdEarthTileSet
java.lang.Object
com.luciad.earth.tileset.ALcdEarthTileSet
- All Implemented Interfaces:
ILcdEarthTileSet
,ILcdBounded
,ILcdDisposable
,AutoCloseable
- Direct Known Subclasses:
TLcdEarthAssetGXYViewTileSet
,TLcdEarthAssetTerrainElevationTileSet
,TLcdEarthCompositeImageTileSet
,TLcdEarthCompositeTileSet
,TLcdEarthGXYViewTileSet
,TLcdEarthTerrainElevationTileSet
,TLcdEarthTerrainHeightTileSet
Abstract base class for
ILcdEarthTileSet
implementations.- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionALcdEarthTileSet
(int aLevels) Creates a tileset with the given number of levels and 2x2 tiles at level 0.ALcdEarthTileSet
(int aLevels, long aLevel0Rows, long aLevel0Columns) Creates a tileset with the given number of levels and tile layout at level 0.Setting the tile layout at level 0 allows keeping the produced tiles approximately square if this tileset covers a non-rectangular region. -
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
containsTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Returns true if the repository contains the specified tile.boolean
containsTileSetCoverage
(String aCoverageName) Returns true if the repository contains a coverage with the specified name.void
dispose()
This method releases all resources held by the repository, such as file locks, threads or server connections.int
Returns the number of available detail levels.protected void
getTileBoundsSFCT
(int aLevel, long aTileX, long aTileY, ILcd2DEditableBounds aBoundsSFCT) long
getTileColumnCount
(int aLevel) Returns the number of columns in the tile grid at the given level.long
getTileRowCount
(int aLevel) Returns the number of rows in the tile grid at the given level.getTileSetCoverage
(String aCoverageName) Returns the tileset coverage with the specified name.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.produceTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, Object aContext) Gets a tile from the repository.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
Methods inherited from interface com.luciad.earth.tileset.ILcdEarthTileSet
getBounds, getTileSetCoverage, getTileSetCoverageCount, produceTile
-
Constructor Details
-
ALcdEarthTileSet
public ALcdEarthTileSet(int aLevels) Creates a tileset with the given number of levels and 2x2 tiles at level 0.- Parameters:
aLevels
- The number of tile levels in this tileset.
-
ALcdEarthTileSet
public ALcdEarthTileSet(int aLevels, long aLevel0Rows, long aLevel0Columns) Creates a tileset with the given number of levels and tile layout at level 0.Setting the tile layout at level 0 allows keeping the produced tiles approximately square if this tileset covers a non-rectangular region. For example using 2 rows and 4 columns at level 0 for a tileset that covers the entire planet results in square tiles (in a geodetic reference).- Parameters:
aLevels
- The number of tile levels in this tileset.aLevel0Rows
- The number of tile rows at level 0.aLevel0Columns
- The number of tile columns at level 0.- See Also:
-
-
Method Details
-
getTileColumnCount
public long getTileColumnCount(int aLevel) Description copied from interface:ILcdEarthTileSet
Returns 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:
getTileColumnCount
in interfaceILcdEarthTileSet
- Parameters:
aLevel
- the level to be queried- Returns:
- the number of tile columns on the specified level
-
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
- 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
-
getTileRowCount
public long getTileRowCount(int aLevel) Description copied from interface:ILcdEarthTileSet
Returns 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:
getTileRowCount
in interfaceILcdEarthTileSet
- Parameters:
aLevel
- the level to be queried- Returns:
- the number of tile rows on the specified level
-
getLevelCount
public int getLevelCount()Description copied from interface:ILcdEarthTileSet
Returns the number of available detail levels. Level 0 is the coarsest level.- Specified by:
getLevelCount
in interfaceILcdEarthTileSet
- Returns:
- the number of available detail levels
-
getTileBoundsSFCT
protected void getTileBoundsSFCT(int aLevel, long aTileX, long aTileY, ILcd2DEditableBounds aBoundsSFCT) -
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
- 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
-
dispose
public void dispose()Description copied from interface:ILcdEarthTileSet
This method releases all resources held by the repository, such as file locks, threads or server connections.- Specified by:
dispose
in interfaceILcdDisposable
- Specified by:
dispose
in interfaceILcdEarthTileSet
-
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
- 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
-
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
- 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
-
updateTile
Description copied from interface:ILcdEarthTileSet
Returns an updated version of the specified tile.- Specified by:
updateTile
in interfaceILcdEarthTileSet
- 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
-
isFormatSupported
Returns true only for the coverage's native format.- Specified by:
isFormatSupported
in interfaceILcdEarthTileSet
- 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) Returns true only for the coverage's native georeference.- Specified by:
isGeoReferenceSupported
in interfaceILcdEarthTileSet
- 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
-
containsTileSetCoverage
Description copied from interface:ILcdEarthTileSet
Returns true if the repository contains a coverage with the specified name.- Specified by:
containsTileSetCoverage
in interfaceILcdEarthTileSet
- Parameters:
aCoverageName
- the name of the coverage to look for- Returns:
- true if the repository contains a coverage with the specified name, false otherwise
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSet
Returns the tileset coverage with the specified name.- Specified by:
getTileSetCoverage
in interfaceILcdEarthTileSet
- Parameters:
aCoverageName
- the name of the coverage to look for- Returns:
- the tileset coverage with the specified name
-