Class TLcdEarthCompositeImageTileSet

java.lang.Object
com.luciad.earth.tileset.ALcdEarthTileSet
com.luciad.earth.tileset.raster.TLcdEarthCompositeImageTileSet
All Implemented Interfaces:
ILcdEarthTileSet, ILcdBounded, ILcdDisposable, AutoCloseable

public class TLcdEarthCompositeImageTileSet extends ALcdEarthTileSet
A composite tileset that combines multiple image tilesets.

This tileset is thread-safe for tile reading if the added tilesets are too.

Since:
8.2
  • Constructor Details

    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdBounds aBounds, int aLevels, int aTileNumXPixels, int aTileNumYPixels)
      Creates a new composite image tileset with the given parameters. The native reference of the composite image coverage will be a geodetic reference. All added tilesets will need to support this reference and the other parameters.
      Parameters:
      aBounds - The bounds of this composite tileset in geodetic coordinates.
      aLevels - The number of levels for this composite tileset.
      aTileNumXPixels - The tile width in pixels of this composite tileset.
      aTileNumYPixels - The tile height in pixels of this composite tileset.
    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileNumXPixels, int aTileNumYPixels)
      Creates a new composite image tileset with the given parameters. The native reference of the composite image coverage will be a geodetic reference. All added tilesets will need to support this reference and the other parameters.
      Parameters:
      aBounds - The bounds of this composite tileset in geodetic coordinates.
      aLevels - The number of levels for this composite tileset.
      aLevel0Rows - The number of tile rows at level 0.
      aLevel0Columns - The number of tile columns at level 0.
      aTileNumXPixels - The tile width in pixels of this composite tileset.
      aTileNumYPixels - The tile height in pixels of this composite tileset.
    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdBounds aBounds, int aLevels, int aTileNumXPixels, int aTileNumYPixels, ILcdGeoReference aNativeReference)
      Creates a new composite image tileset with the given parameters. All added tilesets will need to support these.
      Parameters:
      aBounds - The bounds of this composite tileset in geodetic coordinates.
      aLevels - The number of levels for this composite tileset.
      aTileNumXPixels - The tile width in pixels of this composite tileset.
      aTileNumYPixels - The tile height in pixels of this composite tileset.
      aNativeReference - The native reference of the composite image coverage.
    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileNumXPixels, int aTileNumYPixels, ILcdGeoReference aNativeReference)
      Creates a new composite image tileset with the given parameters. All added tilesets will need to support these.
      Parameters:
      aBounds - The bounds of this composite tileset in geodetic coordinates.
      aLevels - The number of levels for this composite tileset.
      aLevel0Rows - The number of rows at level 0.
      aLevel0Columns - The number of columns at level 0.
      aTileNumXPixels - The tile width in pixels of this composite tileset.
      aTileNumYPixels - The tile height in pixels of this composite tileset.
      aNativeReference - The native reference of the composite image coverage.
    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdEarthTileSet aTileSet, ILcdEarthRasterTileSetCoverage aCoverage)
      Creates a new composite image tileset with the given tileset and coverage as first image. All added tilesets will need to support the parameters (i.e. bounds, tile layout and reference).
      Parameters:
      aTileSet - The tile set for the first image.
      aCoverage - The coverage in this tile set for the first image or null to use the first compatible coverage.
    • TLcdEarthCompositeImageTileSet

      public TLcdEarthCompositeImageTileSet(ILcdEarthTileSet aTileSet, ILcdEarthRasterTileSetCoverage aCoverage, BufferedImageOp aBufferedImageOp, Composite aComposite)
      Creates a new composite image tileset with the given tileset and coverage as first image. All added tilesets will need to support the parameters (i.e. bounds, tile layout and reference).
      Parameters:
      aTileSet - The tile set for the first image.
      aCoverage - The coverage in this tile set for the first image or null to use the first compatible coverage.
      aBufferedImageOp - The operation to perform on the tile image or null to perform none.
      aComposite - The composite operation to perform or null to use the default mode.
  • Method Details

    • getTileProductionMode

      public TLcdEarthCompositeImageTileSet.TileProductionMode getTileProductionMode()
      Returns the mode for producing tiles.
      Returns:
      the mode for producing tiles.
    • setTileProductionMode

      public void setTileProductionMode(TLcdEarthCompositeImageTileSet.TileProductionMode aMode)
      Sets the mode for producing tiles.
      Parameters:
      aMode - the mode that should be used for producing tiles.
    • getImageLayerCount

      public int getImageLayerCount()
      Returns the number of image layers that are composited.
      Returns:
      The number of image layers.
    • getImageLayer

      public TLcdEarthCompositeImageTileSet.ImageLayer getImageLayer(int aIndex)
      Returns the image layer at the given index. Image layers are composited from the lowest index to highest index.
      Parameters:
      aIndex - An index in [0,getImageLayerCount()[.
      Returns:
      The i'th image layer.
      Throws:
      IndexOutOfBoundsException - If the given index is out of bounds.
    • removeImageLayer

      public void removeImageLayer(int aIndex)
      Removes the image layer at the given index.
      Parameters:
      aIndex - An index in [0,getImageLayerCount()[.
      Throws:
      IndexOutOfBoundsException - If the given index is out of bounds.
    • indexOfImageLayer

      public int indexOfImageLayer(TLcdEarthCompositeImageTileSet.ImageLayer aImageLayer)
      Returns the index of the specified image layer or -1 if it is not present.
      Parameters:
      aImageLayer - An image layer.
      Returns:
      An index in [0,getImageLayerCount()[ or -1.
    • indexOfImageLayer

      public int indexOfImageLayer(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage)
      Returns the index of the first image layer with the specified tileset and coverage or -1 if no such image layer is not present.
      Parameters:
      aTileSet - A tileset.
      aCoverage - A coverage or null if any coverage is allowed.
      Returns:
      An index in [0,getImageLayerCount()[ or -1.
    • getImageLayer

      Returns the first image layer with the specified tileset and coverage or null if no such image layer is present.
      Parameters:
      aTileSet - A tileset.
      aCoverage - A coverage or null if any coverage is allowed.
      Returns:
      An image layer or null.
    • moveImageLayer

      public void moveImageLayer(int aIndex, TLcdEarthCompositeImageTileSet.ImageLayer aImageLayer)
      Moves the specified image layer to the specified index.
      Parameters:
      aIndex - An index in [0,getImageLayerCount()[.
      aImageLayer - An image layer.
      Throws:
      NoSuchElementException - if aImageLayer is not an image layer of this tileset.
      IndexOutOfBoundsException - if aIndex is out of bounds.
    • addImageLayer

      public void addImageLayer(ILcdEarthTileSet aTileSet, ILcdEarthRasterTileSetCoverage aCoverage, BufferedImageOp aBufferedImageOp, Composite aComposite)
      Adds an image layer after the last image layer.
      Parameters:
      aTileSet - The tileset for the image layer.
      aCoverage - The coverage in the tileset or null to use the first compatible coverage.
      aBufferedImageOp - The operation to perform on the tile image or null to perform none.
      aComposite - The composite operation to perform or null to use the default mode.
      Throws:
      IllegalArgumentException - If the an image layer with the given parameters is not supported.
      See Also:
    • insertImageLayer

      public void insertImageLayer(ILcdEarthTileSet aTileSet, ILcdEarthRasterTileSetCoverage aCoverage, BufferedImageOp aBufferedImageOp, Composite aComposite, int aIndex)
      Inserts an image layer at the given index.
      Parameters:
      aTileSet - The tileset for the image layer.
      aCoverage - The coverage in the tileset or null to use the first compatible coverage.
      aBufferedImageOp - The operation to perform on the tile images or null to perform none.
      aComposite - The composite operation to perform or null to use the default mode.
      aIndex - An index in [0,getImageLayerCount()[.
      Throws:
      IndexOutOfBoundsException - If the given index is out of bounds.
      IllegalArgumentException - If the an image layer with the given parameters is not supported.
      See Also:
    • setImageLayer

      public void setImageLayer(ILcdEarthTileSet aTileSet, ILcdEarthRasterTileSetCoverage aCoverage, BufferedImageOp aBufferedImageOp, Composite aComposite, int aIndex)
      Sets the image layer at the given index.
      Parameters:
      aTileSet - The tileset for the image layer.
      aCoverage - The coverage in the tileset or null to use the first compatible coverage.
      aBufferedImageOp - The operation to perform on the tile images or null to perform none.
      aComposite - The composite operation to perform or null to use the default mode.
      aIndex - An index in [0,getImageLayerCount()[.
      Throws:
      IndexOutOfBoundsException - If the given index is out of bounds.
      See Also:
    • isSupported

      public boolean isSupported(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage, BufferedImageOp aBufferedImageOp)
      Returns whether an image layer with the given parameters is supported. The image layer is supported if the tileset has the same tile structure as this tileset (e.g. bounds, levels, rows and columns) and the coverage (or a coverage of the tileset if it is not specified) is a raster coverage that is compatible with getComposedImageCoverage().
      Parameters:
      aTileSet - The tileset for the image.
      aCoverage - The coverage in the tileset or null to use the first compatible coverage.
      aBufferedImageOp - The operation to perform on the image or null to perform none.
      Returns:
      whether the image layer is supported.
    • getResultImageType

      public int getResultImageType()
      Returns the image type of the produced BufferedImage's.
      Returns:
      An image type.
      See Also:
    • setResultImageType

      public void setResultImageType(int aImageType)
      Sets the image type of the produced BufferedImage's. It is assumed that the given type is a valid image type for a BufferedImage.
      Parameters:
      aImageType - An image type.
      See Also:
    • getDefaultResultImageType

      public int getDefaultResultImageType()
      Returns the default image type of the produced BufferedImage's.
      Returns:
      An image type.
      See Also:
    • getComposedImageCoverage

      public ILcdEarthRasterTileSetCoverage getComposedImageCoverage()
      Returns the raster coverage for the composed images.
      Returns:
      The composed image coverage.
    • 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's tileAvailable() method. If the tile cannot be produced for some reason, the method tileNotAvailable() should be called instead.

      If the tileset supports it and aMode is TLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS, the tile request may be executed asynchronously. However, the callback must be invoked at some point in time, unless the cancelTile() method is used to cancel the tile request before it is executed. If aMode is TLcdEarthTileOperationMode.FORCE_SYNCHRONOUS, the request must be executed synchronously and the callback must be invoked before produceTile() 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 call tileNotAvailable(). If the tileset calls tileAvailable(), the geo reference of the resulting tile must be equal to aGeoReference, 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, use isFormatSupported(). If the specified format is not supported, the tileset should call tileNotAvailable().

      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 requested
      aLevel - the level from which the tile is requested
      aTileX - the column index of the requested tile
      aTileY - the row index of the requested tile
      aGeoReference - the reference system in which the tile should be returned
      aFormat - the desired format of the tile's data
      aMode - controls the synchronous or asynchronous behaviour of the tileset
      aCallback - will be invoked when the tile is available to be used
      aContext - application-specific data to be used by the tileset, if any
    • dispose

      public void dispose()
      Disposes each of the registered tilesets.
      Specified by:
      dispose in interface ILcdDisposable
      Specified by:
      dispose in interface ILcdEarthTileSet
      Overrides:
      dispose in class ALcdEarthTileSet
    • getBounds

      public ILcdBounds 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

      public ILcdEarthTileSetCoverage getTileSetCoverage(int aIndex)
      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 interface ILcdEarthTileSet
      Overrides:
      isGeoReferenceSupported in class ALcdEarthTileSet
      Parameters:
      aCoverage - the coverage to check for
      aGeoReference - the reference to check for
      Returns:
      true if the given coverage can be queried with the given reference
    • isFormatSupported

      public boolean isFormatSupported(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat)
      Description copied from class: ALcdEarthTileSet
      Returns true only for the coverage's native format.
      Specified by:
      isFormatSupported in interface ILcdEarthTileSet
      Overrides:
      isFormatSupported in class ALcdEarthTileSet
      Parameters:
      aCoverage - the coverage to check for
      aFormat - the format to check for
      Returns:
      true if the given coverage can be queried with the given format