Class TLcdMultilevelTiledModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
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 forILcdIntegerIndexedModel
interface methods and for returning the enumeration of model elements (seeILcdModel.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 (seeTLcdMultilevel2DBoundsIndexedModel.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 implementILcdCharsetSettable
.
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). SeeTLcdMultilevel2DBoundsIndexedModel.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 thedefaultDirectoryPath
. 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 defaultILcdModelDecoder.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, theILcdModelDecoder.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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Deprecated.Checks whether this model decoder can decode the specified data source.Deprecated.Creates a new model from the given data source.Deprecated.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Deprecated.Returns the input stream factory that is used.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Deprecated.Sets the factory that will create the input streams from which property files can be decoded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
TYPE_NAME
Deprecated.- See Also:
-
-
Constructor Details
-
TLcdMultilevelTiledModelDecoder
public TLcdMultilevelTiledModelDecoder()Deprecated.
-
-
Method Details
-
setInputStreamFactory
Deprecated.Sets the factory that will create the input streams from which property files can be decoded.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Deprecated.Description copied from interface:ILcdInputStreamFactoryCapable
Returns the input stream factory that is used.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is used.
-
getDisplayName
Deprecated.Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Deprecated.Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
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 interfaceILcdModelDecoder
- 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
Deprecated.Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- 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:
-