@Deprecated public class TLcdMultilevelRegularTiledModelDecoder extends Object implements 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.
"):
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.
Modifier and Type | Field and Description |
---|---|
static String |
CUMULATIVE
Deprecated.
Name of the property that specifies whether the model is in
cumulative mode. |
static String |
DECODER_DISPLAY_NAME
Deprecated.
Decoder display name.
|
static String |
DEFAULT_DIRECTORY_PATH
Deprecated.
Name of the property corresponding to the default directory path to find the data.
|
static String |
DEFAULT_EXTENSION
Deprecated.
Default file extension (mlm) of the file containing the properties.
|
static String |
DIRECTORY_PATH
Deprecated.
Name of the property corresponding the path containing the data for a specific level.
|
static String |
DISPLAY_NAME
Deprecated.
Name of the property corresponding to the display name.
|
static 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.
|
static String |
LLX
Deprecated.
Name of the property corresponding to the lower left x coordinate of the bounds
of the model to decode.
|
static String |
LLY
Deprecated.
Name of the property corresponding to the lower left y coordinate of the bounds
of the model to decode.
|
static String |
MODEL_HEIGHT
Deprecated.
Name of the property corresponding to the height of the bounds
of the model to decode.
|
static String |
MODEL_REFERENCE_CLASS
Deprecated.
Name of the property corresponding to the
ILcdModelReference class to
be instantiated and initialized for the decoded model. |
static String |
MODEL_WIDTH
Deprecated.
Name of the property corresponding to the width of the bounds
of the model to decode.
|
static String |
NO_OF_LEVELS
Deprecated.
Name of the property that specifies the number of levels within the model.
|
static String |
PREFIX
Deprecated.
This value is used as 'local' prefix for the property names.
|
static String |
RANGE
Deprecated.
Name of the property that specifies the precision values to switch
between the different levels.
|
static String |
SOURCE_NAME
Deprecated.
Name of the property corresponding to the source name.
|
static String |
TILE_DECODER_CLASS
Deprecated.
Name of the property corresponding to the
ILcdTileDecoder class to
be instantiated and initialized. |
static String |
TILE_PROVIDER_CLASS
Deprecated.
Name of the property corresponding to the
ILcdTileProvider class to
be instantiated and initialized. |
static String |
TYPE_NAME
Deprecated.
Name of the property corresponding to the type name.
|
Constructor and Description |
---|
TLcdMultilevelRegularTiledModelDecoder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aFullPathFileName)
Deprecated.
Checks whether
TLcdMultilevel2DBoundsIndexedModelDecoder can
decode the given data. |
ILcdModel |
decode(String aFullPathFileName)
Deprecated.
Creates a new model from the given data source.
|
protected ILcdBounds |
decodeBounds(Properties aProperties,
ILcdModelReference aModelReference,
int aLevel)
Deprecated.
Decodes the bounds object for a particular level.
|
protected ILcd2DBoundsIndexedModel |
decodeLevel(Properties aProperties,
ILcdBounds aModelBounds,
ILcdTileDecoder aTileDecoder,
ILcdModelReference aModelReference,
String aDefaultDirectoryPath,
int aLevel)
Deprecated.
Decodes the sub-model at the specified level.
|
ILcd2DBoundsIndexedModel |
decodeProperties(Properties aProperties)
Deprecated.
Returns the decoded
ILcd2DBoundsIndexedModel from the given set of properties. |
ILcdTileDecoder |
getDefaultTileDecoder()
Deprecated.
Returns the
ILcdTileDecoder that will be used if none is specified in the mlm file. |
String |
getDisplayName()
Deprecated.
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
void |
setDefaultTileDecoder(ILcdTileDecoder aDefaultTileDecoder)
Deprecated.
Sets the default
ILcdTileDecoder to use. |
protected void |
setModelDescriptorSFCT(Properties aProperties,
TLcdMultilevel2DBoundsIndexedModel aMultilevelModel)
Deprecated.
Overwrite this method to set an
ILcdModelDescriptor based on the properties. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String DECODER_DISPLAY_NAME
public static final String DEFAULT_EXTENSION
public static final String PREFIX
public static final String DISPLAY_NAME
public static final String SOURCE_NAME
public static final String TYPE_NAME
public static final String DEFAULT_DIRECTORY_PATH
public static final String DIRECTORY_PATH
DEFAULT_DIRECTORY_PATH
,
Constant Field Valuespublic static final String MODEL_REFERENCE_CLASS
ILcdModelReference
class to
be instantiated and initialized for the decoded model.public static final String TILE_DECODER_CLASS
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.public static final String TILE_PROVIDER_CLASS
ILcdTileProvider
class to
be instantiated and initialized.public static final String LLX
public static final String LLY
public static final String MODEL_WIDTH
public static final String MODEL_HEIGHT
public static final String NO_OF_LEVELS
public static final String RANGE
public static final String CUMULATIVE
cumulative
mode.
If not specified the resulting state will be false.public static final String LEVEL
public TLcdMultilevelRegularTiledModelDecoder()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public void setDefaultTileDecoder(ILcdTileDecoder aDefaultTileDecoder)
ILcdTileDecoder
to use.aDefaultTileDecoder
- the new default decoder for tiles of sub-models.getDefaultTileDecoder()
public ILcdTileDecoder getDefaultTileDecoder()
ILcdTileDecoder
that will be used if none is specified in the mlm file.ILcdTileDecoder
that will be used if none is specified in the mlm file.setDefaultTileDecoder(com.luciad.model.ILcdTileDecoder)
public boolean canDecodeSource(String aFullPathFileName)
TLcdMultilevel2DBoundsIndexedModelDecoder
can
decode the given data. The extension of the file name should be "mlm".canDecodeSource
in interface ILcdModelDecoder
aFullPathFileName
- the name of the file or URL that is to be decoded.true
if TLcdMultilevel2DBoundsIndexedModelDecoder
can decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aFullPathFileName) throws IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aFullPathFileName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.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);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)
public ILcd2DBoundsIndexedModel decodeProperties(Properties aProperties) throws IllegalArgumentException
ILcd2DBoundsIndexedModel
from the given set of properties.aProperties
- the Property object containing the serialized model properties.ILcd2DBoundsIndexedModel
from the given set of properties.IllegalArgumentException
- if there is an error in the Properties object.protected void setModelDescriptorSFCT(Properties aProperties, TLcdMultilevel2DBoundsIndexedModel aMultilevelModel) throws IllegalArgumentException
ILcdModelDescriptor
based on the properties.
Doesn't perform any operation by default.aProperties
- the Properties object containing the serialized model properties.aMultilevelModel
- the model to set the model descriptor for by side effect.IllegalArgumentException
- if the model descriptor cannot be set properly.protected ILcdBounds decodeBounds(Properties aProperties, ILcdModelReference aModelReference, int aLevel)
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.ILcdBounds
object.protected ILcd2DBoundsIndexedModel decodeLevel(Properties aProperties, ILcdBounds aModelBounds, ILcdTileDecoder aTileDecoder, ILcdModelReference aModelReference, String aDefaultDirectoryPath, int aLevel) throws ClassNotFoundException, IllegalAccessException, InstantiationException
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.ILcd2DBoundsIndexedModel
at level aLevel
.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.