Class TLcdMultilevelRegularTiledModelDecoder

java.lang.Object
com.luciad.model.TLcdMultilevelRegularTiledModelDecoder
All Implemented Interfaces:
ILcdModelDecoder

@Deprecated public class TLcdMultilevelRegularTiledModelDecoder extends Object implements ILcdModelDecoder
Deprecated.
This API is only here to support deprecated formats.
TLcdMultilevelRegularTiledModelDecoder implements an ILcdModelDecoder for decoding mlm files. A mlm file describes the structure of one or more levels of vector data. Each level consists of a regular grid of vector data files. All vector data files have to be of the same format and the same model reference. Subsequent levels describe objects with increasing detail.

All vector tiles at a given level have equal sizes in model coordinates. The number of row and column tiles can be different for each level. The grid does not have to be completely filled.

TLcdMultilevelRegularTiledModelDecoder looks for the following properties when decoding a mlm file (each of the keys must be preceded by "TLcdMultilevelRegularTiledModelDecoder."):

  • General information on the data:
    • displayName: a convenient name for the data.
    • sourceName: the name of the source file.
    • typeName: the type of the data.

    Information needed to decode each of the vector tiles.

    • ILcdTileDecoder.class: the name of the class responsible for decoding the vector tiles. If it is not present, one should set as property of this TLcdMultilevelRegularTiledModelDecoder the default ILcdTileDecoder to use.

    Information for constructing the TLcdMultilevelRegularTiledModelDecoder.

    • noLevels: number of levels (has to be at least 1).
    • level1.llx: the lower-left corner abscissa of the model at level l.
    • level1.lly: the lower-left corner ordinate of the model at level l.
    • level1.modelWidth: the width of the model, expressed in model coordinates at level l.
    • level1.modelHeight: the width of the model, expressed in model coordinates at level l.
    • level1.range: a precision range for of the model at level l. It is used to determine which approximation level should be used.
    • level1.noOfTileRows: the number of tile rows at level l.
    • level1.noOfTileColumns.: the number of tile columns at level l.

    The name of the class implementing ILcdTileProvider used for retrieving the tiles:

  • level1.ILcdTileProvider.class : the name of the class for responsible for retrieving tiles at level l. The properties that will hold references to the files containing the data if this information has to be retrieved from the properties:
  • level1.fileName.r.c: the file name at row r, column c, and level l.

A set of properties holding the information for creating the appropriate ILcdModelReference. The creation as such of an ILcdModelReference is taken care of by the TLcdModelRefFactory. From the properties file it will look for the properties which are of interest to it. Exactly which properties are required here, depends on what ILcdModelReference to create. For more information on what properties are needed, see the various ILcdModelReference implementations.

The decoded model is a TLcdMultilevel2DBoundsIndexedModel containing an ILcd2DBoundsIndexedModel for each level.

By default no ILcdModelDescriptor is set. Overwrite the method setModelDescriptorSFCT to create your own ILcdModelDescriptor from the properties.

Since:
V2.0
  • Field Details

    • DECODER_DISPLAY_NAME

      public static final String DECODER_DISPLAY_NAME
      Deprecated.
      Decoder display name.
      See Also:
    • DEFAULT_EXTENSION

      public static final String DEFAULT_EXTENSION
      Deprecated.
      Default file extension (mlm) of the file containing the properties.
      See Also:
    • PREFIX

      public static final String PREFIX
      Deprecated.
      This value is used as 'local' prefix for the property names.
      See Also:
    • DISPLAY_NAME

      public static final String DISPLAY_NAME
      Deprecated.
      Name of the property corresponding to the display name.
      See Also:
    • SOURCE_NAME

      public static final String SOURCE_NAME
      Deprecated.
      Name of the property corresponding to the source name.
      See Also:
    • TYPE_NAME

      public static final String TYPE_NAME
      Deprecated.
      Name of the property corresponding to the type name.
      See Also:
    • DEFAULT_DIRECTORY_PATH

      public static final String DEFAULT_DIRECTORY_PATH
      Deprecated.
      Name of the property corresponding to the default directory path to find the data. This property is set within the decoder to the path of the mlm file.
      See Also:
    • DIRECTORY_PATH

      public static final String DIRECTORY_PATH
      Deprecated.
      Name of the property corresponding the path containing the data for a specific level. If not specified the default directory path is used.
      See Also:
    • MODEL_REFERENCE_CLASS

      public static final String MODEL_REFERENCE_CLASS
      Deprecated.
      Name of the property corresponding to the ILcdModelReference class to be instantiated and initialized for the decoded model.
      See Also:
    • TILE_DECODER_CLASS

      public static final String TILE_DECODER_CLASS
      Deprecated.
      Name of the property corresponding to the ILcdTileDecoder class to be instantiated and initialized. Doesn't have to be specified but in that case a ILcdTileDecoder has to be provided to this decoder.
      See Also:
    • TILE_PROVIDER_CLASS

      public static final String TILE_PROVIDER_CLASS
      Deprecated.
      Name of the property corresponding to the ILcdTileProvider class to be instantiated and initialized.
      See Also:
    • LLX

      public static final String LLX
      Deprecated.
      Name of the property corresponding to the lower left x coordinate of the bounds of the model to decode.
      See Also:
    • LLY

      public static final String LLY
      Deprecated.
      Name of the property corresponding to the lower left y coordinate of the bounds of the model to decode.
      See Also:
    • MODEL_WIDTH

      public static final String MODEL_WIDTH
      Deprecated.
      Name of the property corresponding to the width of the bounds of the model to decode.
      See Also:
    • MODEL_HEIGHT

      public static final String MODEL_HEIGHT
      Deprecated.
      Name of the property corresponding to the height of the bounds of the model to decode.
      See Also:
    • NO_OF_LEVELS

      public static final String NO_OF_LEVELS
      Deprecated.
      Name of the property that specifies the number of levels within the model.
      See Also:
    • RANGE

      public static final String RANGE
      Deprecated.
      Name of the property that specifies the precision values to switch between the different levels. To be used in conjunction with the level.
      See Also:
    • CUMULATIVE

      public static final String CUMULATIVE
      Deprecated.
      Name of the property that specifies whether the model is in cumulative mode. If not specified the resulting state will be false.
      See Also:
    • LEVEL

      public static final String LEVEL
      Deprecated.
      Part of the name of the property together with the level number used for properties giving details of the sub-model at a particular level.
      See Also:
  • Constructor Details

    • TLcdMultilevelRegularTiledModelDecoder

      public TLcdMultilevelRegularTiledModelDecoder()
      Deprecated.
  • Method Details

    • 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.
    • setDefaultTileDecoder

      public void setDefaultTileDecoder(ILcdTileDecoder aDefaultTileDecoder)
      Deprecated.
      Sets the default ILcdTileDecoder to use.
      Parameters:
      aDefaultTileDecoder - the new default decoder for tiles of sub-models.
      See Also:
    • getDefaultTileDecoder

      public ILcdTileDecoder getDefaultTileDecoder()
      Deprecated.
      Returns the ILcdTileDecoder that will be used if none is specified in the mlm file.
      Returns:
      the ILcdTileDecoder that will be used if none is specified in the mlm file.
      See Also:
    • canDecodeSource

      public boolean canDecodeSource(String aFullPathFileName)
      Deprecated.
      Checks whether TLcdMultilevel2DBoundsIndexedModelDecoder can decode the given data. The extension of the file name should be "mlm".
      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aFullPathFileName - the name of the file or URL that is to be decoded.
      Returns:
      true if TLcdMultilevel2DBoundsIndexedModelDecoder can decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aFullPathFileName) throws IOException
      Deprecated.
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aFullPathFileName - 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:
    • decodeProperties

      public ILcd2DBoundsIndexedModel decodeProperties(Properties aProperties) throws IllegalArgumentException
      Deprecated.
      Returns the decoded ILcd2DBoundsIndexedModel from the given set of properties.
      Parameters:
      aProperties - the Property object containing the serialized model properties.
      Returns:
      the decoded ILcd2DBoundsIndexedModel from the given set of properties.
      Throws:
      IllegalArgumentException - if there is an error in the Properties object.
    • setModelDescriptorSFCT

      protected void setModelDescriptorSFCT(Properties aProperties, TLcdMultilevel2DBoundsIndexedModel aMultilevelModel) throws IllegalArgumentException
      Deprecated.
      Overwrite this method to set an ILcdModelDescriptor based on the properties. Doesn't perform any operation by default.
      Parameters:
      aProperties - the Properties object containing the serialized model properties.
      aMultilevelModel - the model to set the model descriptor for by side effect.
      Throws:
      IllegalArgumentException - if the model descriptor cannot be set properly.
    • decodeBounds

      protected ILcdBounds decodeBounds(Properties aProperties, ILcdModelReference aModelReference, int aLevel)
      Deprecated.
      Decodes the bounds object for a particular level. Set the level to a value strictly less than 0 to get the model bounds.
      Parameters:
      aProperties - the Properties object containing the serialized model properties.
      aModelReference - the ILcdModelReference of the model.
      aLevel - the bounds of the sub-model at level aLevel. If aLevel is -1 the global model bounds are decoded.
      Returns:
      the decoded ILcdBounds object.
    • decodeLevel

      protected ILcd2DBoundsIndexedModel decodeLevel(Properties aProperties, ILcdBounds aModelBounds, ILcdTileDecoder aTileDecoder, ILcdModelReference aModelReference, String aDefaultDirectoryPath, int aLevel) throws ClassNotFoundException, IllegalAccessException, InstantiationException
      Deprecated.
      Decodes the sub-model at the specified level.
      Parameters:
      aProperties - the Properties object representing the model being decoded.
      aModelBounds - the global model bounds.
      aTileDecoder - the ILcdTileDecoder to decode tiles from within a sub-model.
      aModelReference - the ILcdModelReference of the decoded model.
      aDefaultDirectoryPath - the default directory path to find the data for tiles.
      aLevel - the level of the sub-model to be decoded.
      Returns:
      the decoded ILcd2DBoundsIndexedModel at level aLevel.
      Throws:
      ClassNotFoundException - if the Class cannot be found in the class path.
      IllegalAccessException - if there is no access to the zero-argument Class constructor.
      InstantiationException - if the object cannot be instantiated.