Class TLcdMultilevelTiledModelDecoder

java.lang.Object
com.luciad.model.TLcdMultilevelTiledModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@Deprecated public class TLcdMultilevelTiledModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
Deprecated.
This ILcdModelDecoder decodes multi-level, non-regularly tiled models. The tiles may be of different sizes and may overlap. The number of tiles is not required to be the same for each level. Each tile is encoded separately in one file, and the tiles may be of different types.

The model consists of one master file with the extension ".mtm" and several data files, one for each tile at a level of detail. The master file is a Java properties file that must contain the following keys. Each of the keys must be preceded by "TLcdMultilevelTiledModel.".

General model properties:

  • noLevels: The number of levels.
  • defaultLevel: The default level to use for ILcdIntegerIndexedModel interface methods and for returning the enumeration of model elements (see ILcdModel.elements()). If not specified, the default is the most detailed level.
  • cumulative (default=false); Boolean value saying if the model at a particular level includes the lower-detail levels (see TLcdMultilevel2DBoundsIndexedModel.isCumulative())
  • directoryPath: The default path to the tiles. This value must end with a separator character (forward slash). If not specified, the default path is the directory of the master file.
  • ILcdModelDecoder.class (default=none): The default tile decoder.
  • charSet (optional): The name of the character set to be used by the tile decoders. It affects only the tile decoders that implement ILcdCharsetSettable.

Information related to a particular level:

  • range.l: The start of the scale range interval from which level l should be used. This value should be expressed in the units of the ILcdModelReference of the ILcdModel. The levels are expected to be sorted from lowest to highest detail (= from high to low value of the range coefficient). See TLcdMultilevel2DBoundsIndexedModel.setRange(double[]). The range corresponding to level l is [scale.l .. scale.(l+1)). If not specified otherwise, range(noLevels+1) is automatically set to 0.
  • directoryPath.l: The subdirectory containing tiles for level l. This value is relative to the defaultDirectoryPath. It must end with a file separator character.
  • noFiles.l: The number of files (=number of tiles) at level l.
  • ILcdModelDecoder.class.l: The default decoder to use for level l tiles. If not specified, the default ILcdModelDecoder.class is used.

Information related to a particular tile:

  • fileName.l.t: The name of the file corresponding to tile t from level l.
  • bounds.x.l.t: The x-ordinate of the bottom-left point of tile t from level l.
  • bounds.y.l.t: The y-ordinate of the bottom-left point of tile t from level l.
  • bounds.width.l.t: The width of tile t from level l.
  • bounds.height.l.t: The height of tile t from level l.
  • ILcdModelDecoder.class.l.t: Specific decoder for tile t from level l. If not specified, the ILcdModelDecoder.class.l of this level is used.

Each individual tile is kept in a TLcdSoft2DBoundsIndexedModel, that performs lazy loading and soft caching. The final model is a TLcdMultilevel2DBoundsIndexedModel. The decoded model itself is thread-safe for read-only access. However, please note that decoding of the submodels is delegated to other decoders at unpredictable moments. To insure thread-safety, both the sub-model decoders and the decoded sub-models must be thread-safe.

Since:
6.0
See Also:
  • Field Details

  • Constructor Details

    • TLcdMultilevelTiledModelDecoder

      public TLcdMultilevelTiledModelDecoder()
      Deprecated.
  • Method Details

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Deprecated.
      Sets the factory that will create the input streams from which property files can be decoded.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Deprecated.
      Description copied from interface: ILcdInputStreamFactoryCapable
      Returns the input stream factory that is used.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • getDisplayName

      public String getDisplayName()
      Deprecated.
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Deprecated.
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws an exception for that same source name.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Deprecated.
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      A model containing the decoded data. While null is allowed, implementors are advised to throw an error instead.
      Throws:
      IOException - for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.
      
         public ILcdModel decode( String aSourceName ) throws IOException {
            try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
               // Perform decoding ...
            } catch (RuntimeException e) {
               throw new IOException(e);
            }
         }
       
      See Also: