Class TLcdMultilevelRegularTiledModelDecoder
- All Implemented Interfaces:
ILcdModelDecoder
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 thisTLcdMultilevelRegularTiledModelDecoderthe defaultILcdTileDecoderto 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
ILcdTileProviderused 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Name of the property that specifies whether the model is incumulativemode.static final StringDeprecated.Decoder display name.static final StringDeprecated.Name of the property corresponding to the default directory path to find the data.static final StringDeprecated.Default file extension (mlm) of the file containing the properties.static final StringDeprecated.Name of the property corresponding the path containing the data for a specific level.static final StringDeprecated.Name of the property corresponding to the display name.static final StringDeprecated.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.static final StringDeprecated.Name of the property corresponding to the lower left x coordinate of the bounds of the model to decode.static final StringDeprecated.Name of the property corresponding to the lower left y coordinate of the bounds of the model to decode.static final StringDeprecated.Name of the property corresponding to the height of the bounds of the model to decode.static final StringDeprecated.Name of the property corresponding to theILcdModelReferenceclass to be instantiated and initialized for the decoded model.static final StringDeprecated.Name of the property corresponding to the width of the bounds of the model to decode.static final StringDeprecated.Name of the property that specifies the number of levels within the model.static final StringDeprecated.This value is used as 'local' prefix for the property names.static final StringDeprecated.Name of the property that specifies the precision values to switch between the different levels.static final StringDeprecated.Name of the property corresponding to the source name.static final StringDeprecated.Name of the property corresponding to theILcdTileDecoderclass to be instantiated and initialized.static final StringDeprecated.Name of the property corresponding to theILcdTileProviderclass to be instantiated and initialized.static final StringDeprecated.Name of the property corresponding to the type name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aFullPathFileName) Deprecated.Checks whetherTLcdMultilevel2DBoundsIndexedModelDecodercan decode the given data.Deprecated.Creates a new model from the given data source.protected ILcdBoundsdecodeBounds(Properties aProperties, ILcdModelReference aModelReference, int aLevel) Deprecated.Decodes the bounds object for a particular level.protected ILcd2DBoundsIndexedModeldecodeLevel(Properties aProperties, ILcdBounds aModelBounds, ILcdTileDecoder aTileDecoder, ILcdModelReference aModelReference, String aDefaultDirectoryPath, int aLevel) Deprecated.Decodes the sub-model at the specified level.decodeProperties(Properties aProperties) Deprecated.Returns the decodedILcd2DBoundsIndexedModelfrom the given set of properties.Deprecated.Returns theILcdTileDecoderthat will be used if none is specified in the mlm file.Deprecated.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.voidsetDefaultTileDecoder(ILcdTileDecoder aDefaultTileDecoder) Deprecated.Sets the defaultILcdTileDecoderto use.protected voidsetModelDescriptorSFCT(Properties aProperties, TLcdMultilevel2DBoundsIndexedModel aMultilevelModel) Deprecated.Overwrite this method to set anILcdModelDescriptorbased on the properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
DECODER_DISPLAY_NAME
Deprecated.Decoder display name.- See Also:
-
DEFAULT_EXTENSION
Deprecated.Default file extension (mlm) of the file containing the properties.- See Also:
-
PREFIX
Deprecated.This value is used as 'local' prefix for the property names.- See Also:
-
DISPLAY_NAME
Deprecated.Name of the property corresponding to the display name.- See Also:
-
SOURCE_NAME
Deprecated.Name of the property corresponding to the source name.- See Also:
-
TYPE_NAME
Deprecated.Name of the property corresponding to the type name.- See Also:
-
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
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
Deprecated.Name of the property corresponding to theILcdModelReferenceclass to be instantiated and initialized for the decoded model.- See Also:
-
TILE_DECODER_CLASS
Deprecated.Name of the property corresponding to theILcdTileDecoderclass to be instantiated and initialized. Doesn't have to be specified but in that case aILcdTileDecoderhas to be provided to this decoder.- See Also:
-
TILE_PROVIDER_CLASS
Deprecated.Name of the property corresponding to theILcdTileProviderclass to be instantiated and initialized.- See Also:
-
LLX
Deprecated.Name of the property corresponding to the lower left x coordinate of the bounds of the model to decode.- See Also:
-
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
Deprecated.Name of the property corresponding to the width of the bounds of the model to decode.- See Also:
-
MODEL_HEIGHT
Deprecated.Name of the property corresponding to the height of the bounds of the model to decode.- See Also:
-
NO_OF_LEVELS
Deprecated.Name of the property that specifies the number of levels within the model.- See Also:
-
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
Deprecated.Name of the property that specifies whether the model is incumulativemode. If not specified the resulting state will be false.- See Also:
-
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
Deprecated.Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
setDefaultTileDecoder
Deprecated.Sets the defaultILcdTileDecoderto use.- Parameters:
aDefaultTileDecoder- the new default decoder for tiles of sub-models.- See Also:
-
getDefaultTileDecoder
Deprecated.Returns theILcdTileDecoderthat will be used if none is specified in the mlm file.- Returns:
- the
ILcdTileDecoderthat will be used if none is specified in the mlm file. - See Also:
-
canDecodeSource
Deprecated.Checks whetherTLcdMultilevel2DBoundsIndexedModelDecodercan decode the given data. The extension of the file name should be "mlm".- Specified by:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aFullPathFileName- the name of the file or URL that is to be decoded.- Returns:
trueifTLcdMultilevel2DBoundsIndexedModelDecodercan decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Deprecated.Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aFullPathFileName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis 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 decodedILcd2DBoundsIndexedModelfrom the given set of properties.- Parameters:
aProperties- the Property object containing the serialized model properties.- Returns:
- the decoded
ILcd2DBoundsIndexedModelfrom 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 anILcdModelDescriptorbased 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- theILcdModelReferenceof the model.aLevel- the bounds of the sub-model at levelaLevel. IfaLevelis -1 the global model bounds are decoded.- Returns:
- the decoded
ILcdBoundsobject.
-
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- theILcdTileDecoderto decode tiles from within a sub-model.aModelReference- theILcdModelReferenceof 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
ILcd2DBoundsIndexedModelat levelaLevel. - 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.
-