Class TLcdEarthLevelFallbackTileSet

java.lang.Object
com.luciad.earth.tileset.util.ALcdEarthTileSetWrapper
com.luciad.earth.tileset.util.TLcdEarthLevelFallbackTileSet
All Implemented Interfaces:
ILcdEarthTileSet, ILcdBounded, ILcdDisposable, AutoCloseable

public class TLcdEarthLevelFallbackTileSet extends ALcdEarthTileSetWrapper
A tileset that tries to create missing tiles by splitting tiles at lower levels.

This tileset is thread-safe for tile reading if the delegate tileset is also thread-safe for tile reading and the tile splitters are thread-safe.

Since:
8.2
  • Constructor Details

    • TLcdEarthLevelFallbackTileSet

      public TLcdEarthLevelFallbackTileSet(ILcdEarthTileSet aDelegate)
      Creates a new level fallback tileset with the same number of levels as the given tile set.
      Parameters:
      aDelegate - The delegate tileset.
  • Method Details

    • setTileSplitter

      public void setTileSplitter(ILcdEarthTileSplitter aTileSplitter, ILcdEarthTileSetCoverage aCoverage)
      Sets the tile splitter used for the given coverage.
      Parameters:
      aTileSplitter - A tile splitter or null to set none.
      aCoverage - A earth coverage.
      Throws:
      IllegalArgumentException - If the tile splitter cannot split the tiles from the coverage.
    • addTileSplitter

      public void addTileSplitter(ILcdEarthTileSplitter aTileSplitter)
      Adds a tile splitter. The tile splitter is set for all coverages that support the tile splitter's data format class.
      Parameters:
      aTileSplitter - A tile splitter.
    • setTileSplitter

      public void setTileSplitter(ILcdEarthTileSplitter aTileSplitter, TLcdEarthTileFormat aDataFormatClass)
      Sets the tile splitter of all coverages that support the given data format class.
      Parameters:
      aTileSplitter - A tile splitter.
      aDataFormatClass - A data format class.
    • getTileSplitter

      public ILcdEarthTileSplitter getTileSplitter(ILcdEarthTileSetCoverage aCoverage)
      Returns the tile splitter that is currently set for the given coverage.
      Parameters:
      aCoverage - A coverage of this tileset.
      Returns:
      A tile splitter or null if none has been set.
    • 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 interface ILcdEarthTileSet
      Overrides:
      produceTile in class ALcdEarthTileSetWrapper
      Parameters:
      aCoverage - the coverage from which to query a tile
      aLevel - the detail level for which to query a tile
      aX - the column index at which to query a tile
      aY - the row index at which to query a tile
      aGeoReference - the georeference of the requested tile
      aFormat - the format of the requested tile
      aContext - 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
    • 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.

      Specified by:
      produceTile in interface ILcdEarthTileSet
      Overrides:
      produceTile in class ALcdEarthTileSetWrapper
      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
    • updateTile

      public ALcdEarthTile updateTile(ALcdEarthTile aEarthTile, Object aContext) throws IOException
      Description copied from interface: ILcdEarthTileSet
      Returns an updated version of the specified tile.
      Specified by:
      updateTile in interface ILcdEarthTileSet
      Overrides:
      updateTile in class ALcdEarthTileSetWrapper
      Parameters:
      aEarthTile - the tile to check
      aContext - 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: 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 interface ILcdEarthTileSet
      Overrides:
      updateTile in class ALcdEarthTileSetWrapper
      Parameters:
      aTile - tile to check
      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
    • cancelTile

      public void cancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext)
      Description copied from class: ALcdEarthTileSetWrapper
      This method should be overridden if the produceTile and/or updateTile is overridden and the new implementation calls the implementation of this class using different parameters than passed to it.

      If the produceTile is overridden as

       super.produceTile( myCoverage, aLevel, aTileX, aTileY, aGeoReference, aFormat, aMode, new MyTileSetCallback( aCallback ), aContext );
       
      this method should be overridden as
       super.cancelTile( aLevel, aTileX, aTileY, myCoverage, aGeoReference, aFormat, new MyTileSetCallback( aCallback ), aContext );
       
      where MyTileSetCallback instances with the same delegate callback are equal.
      Specified by:
      cancelTile in interface ILcdEarthTileSet
      Overrides:
      cancelTile in class ALcdEarthTileSetWrapper
      Parameters:
      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
      aCoverage - the coverage from which the tile is requested
      aGeoReference - the reference system in which the tile is requested
      aFormat - the format in which the tile is requested
      aCallback - would be invoked when the tile would have been available to be used
      aContext - application-specific data to be used by the tileset, if any