Class TLcdEarthAssetGXYViewTileSet
- All Implemented Interfaces:
ILcdEarthTileSet,ILcdBounded,ILcdDisposable,AutoCloseable
TLcdEarthGXYViewTileSet
but uses a model with ILcdEarthAssets instead of a ILcdGXYLayers to generate image tiles.
To produce or update a tile only the assets that have ILcdEarthTileSetCoverage.CoverageType.IMAGE
as coverage type and overlap with the tile are used. The gxy layers of these assets are created
lazily by using their model decoder to create a model and passing this model to the layer
factory. The order of the overlapping assets is determined using their natural
ordering.
Changes to the asset model are taken into account in subsequent produced or updated tiles.
This class is thread-safe.- Since:
- 9.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdEarthAssetGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0RowCount, long aLevel0ColCount, int aImageTileWidth, int aImageTileHeight, ILcdGeoReference aTileSetReference, ILcdModel aAssetModel, ILcdGXYLayerFactory aLayerFactory) Constructs a newTLcdEarthAssetGXYViewTileSetwith the specified settings.TLcdEarthAssetGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0RowCount, long aLevel0ColCount, int aImageTileResolution, ILcdGeoReference aTileSetReference, ILcdModel aAssetModel, ILcdGXYLayerFactory aLayerFactory) Constructs a newTLcdEarthAssetGXYViewTileSetwith the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelTile(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.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.Returns the GXY layer factory used for creating layers for the models.Returns theTLcdEarthGXYViewTileSetthat is used to generate the tiles.Returns the model decoder factory used for decoding the assets.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 only for the coverage's native format.booleanisGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Returns true only for the coverage's native georeference.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.voidsetModelDecoderFactory(ILcdEarthModelDecoderFactory aModelDecoderFactory) Sets the model decoder factory used for decoding the assets.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.ALcdEarthTileSet
getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCountMethods 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
-
TLcdEarthAssetGXYViewTileSet
public TLcdEarthAssetGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0RowCount, long aLevel0ColCount, int aImageTileWidth, int aImageTileHeight, ILcdGeoReference aTileSetReference, ILcdModel aAssetModel, ILcdGXYLayerFactory aLayerFactory) Constructs a newTLcdEarthAssetGXYViewTileSetwith the specified settings.- Parameters:
aBounds- the bounds of the tileset in the model referenceaLevels- the number of tile levelsaLevel0RowCount- the number of tile rows at level 0aLevel0ColCount- the number of tile columns at level 0aImageTileWidth- the X-resolution of a single tileaImageTileHeight- the Y-resolution of a single tileaTileSetReference- the reference in which the tileset's bounds and tile pyramid are definedaAssetModel- the asset modelaLayerFactory- the layer factory that will be used to create layer's from the models
-
TLcdEarthAssetGXYViewTileSet
public TLcdEarthAssetGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0RowCount, long aLevel0ColCount, int aImageTileResolution, ILcdGeoReference aTileSetReference, ILcdModel aAssetModel, ILcdGXYLayerFactory aLayerFactory) Constructs a newTLcdEarthAssetGXYViewTileSetwith the specified settings.- Parameters:
aBounds- the bounds of the tileset in the model referenceaLevels- the number of tile levelsaLevel0RowCount- the number of tile rows at level 0aLevel0ColCount- the number of tile columns at level 0aImageTileResolution- the resolution of a single tile, both for X- and Y-resolutionsaTileSetReference- the reference in which the tileset's bounds and tile pyramid are definedaAssetModel- the asset modelaLayerFactory- the layer factory that will be used to create layer's from the models
-
-
Method Details
-
setModelDecoderFactory
Sets the model decoder factory used for decoding the assets. When set, model decoders will be created through this factory, rather than retrieved from the assets themselves.- Parameters:
aModelDecoderFactory- the model decoder factory
-
getModelDecoderFactory
Returns the model decoder factory used for decoding the assets.- Returns:
- the model decoder factory
- See Also:
-
getGXYLayerFactory
Returns the GXY layer factory used for creating layers for the models.- Returns:
- the layer factory
-
getGXYViewTileSet
Returns theTLcdEarthGXYViewTileSetthat is used to generate the tiles.- Returns:
- the
TLcdEarthGXYViewTileSetthat is used to generate the tiles.
-
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 classALcdEarthTileSet
-
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.- 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 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: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 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:ILcdEarthTileSetReturns an updated version of the specified tile.- Specified by:
updateTilein interfaceILcdEarthTileSet- Overrides:
updateTilein 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
-
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 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
-
cancelTile
public void cancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSetCancels 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 theILcdEarthTileSetCallbackfor the tile in question. The tileset is not obligated to honor thecancelTile()request, but ifcancelTile()is not called, then it is required to invoke theILcdEarthTileSetCallbackat some point.- Specified by:
cancelTilein interfaceILcdEarthTileSet- Overrides:
cancelTilein 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
-
isGeoReferenceSupported
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Description copied from class:ALcdEarthTileSetReturns true only for the coverage's native georeference.- Specified by:
isGeoReferenceSupportedin interfaceILcdEarthTileSet- Overrides:
isGeoReferenceSupportedin 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:ALcdEarthTileSetReturns true only for the coverage's native format.- Specified by:
isFormatSupportedin interfaceILcdEarthTileSet- Overrides:
isFormatSupportedin 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
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns the tileset coverage with the specified name.- Specified by:
getTileSetCoveragein interfaceILcdEarthTileSet- Overrides:
getTileSetCoveragein classALcdEarthTileSet- Parameters:
aCoverageName- the name of the coverage to look for- Returns:
- the tileset coverage with the specified name
-
containsTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns true if the repository contains a coverage with the specified name.- Specified by:
containsTileSetCoveragein interfaceILcdEarthTileSet- Overrides:
containsTileSetCoveragein classALcdEarthTileSet- 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:ILcdEarthTileSetReturns the coverage at the specified index.- 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.- Returns:
- the number of coverages this tileset contains
-
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.- Returns:
- the bounds of this tile set
- See Also:
-