Package com.luciad.format.asdi
Class TLcdASDIModelDecoder
java.lang.Object
com.luciad.format.asdi.ALcdASDIDecoder
com.luciad.format.asdi.TLcdASDIModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdASDIModelDecoder
extends ALcdASDIDecoder
implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This decoder reads data from an ASDI feed and returns the information
in a
The domain objects group messages that belong together.
TLcdModelList
, allowing for easy manipulation of that data,
such as replaying, analysis, etc.
An ASDI file can contain a <set time > MM/dd/yyyy HH:mm:ss
command at the first line. If this is the case the corresponding date
is used as the start time for the decoder,
the start time set by ALcdASDIDecoder.setStartTime(long)
is ignored then.
Input files
File | Required | Entry point | Description |
---|---|---|---|
*.asdi | x | x | ASDI file containing an ASDI formatted data |
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
ILcdInputStreamFactory
of this decoder.
Model structure
- This model decoder returns a
model list
with a model for each data type in the input. - The model list contains different
ILcdModel
objects, depending on the type of messages in the ASDI feed. - All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
Model descriptor
- All
ILcdModel
objects have anILcdModelDescriptor
that is anALcdASDIModelDescriptor
. The methodALcdASDIModelDescriptor.getDataType()
allows to distinguish between the different models.
Model reference
- All models returned by this model decoder have a
TLcdGeodeticReference
. - The used datum is a standard
TLcdGeodeticDatum
(WGS-84).
Model elements
All domain objects decoded with this decoder implement the ILcdDataObject interface. This interface allows you to retrieve information on each of the domain models of ASDI in a uniform way. The data models and types can be obtained from either the domain objects or from the TLcdASDIDataTypes class. Following table gives an overview of the different models in theTLcdModelList
,
specifying for each a description, the messages taken into account,
the domain objects in the model and the value returned from
ALcdASDIModelDescriptor.getDataType()
:
Model description | ASDI messages | Domain objects | ALcdASDIModelDescriptor.getDataType() |
---|---|---|---|
TZ tracks | TZ | TLcdASDITrajectory |
DATA_TYPE_TZ_TRACK |
TO tracks | TO | TLcdASDITrajectory |
DATA_TYPE_TO_TRACK |
Flight plan data | FZ, AF, DZ, UZ, AZ, RZ and RT | TLcdASDIFlightPlanHistory |
DATA_TYPE_FLIGHT_PLAN |
The domain objects group messages that belong together.
Sample code
ILcdModelDecoder decoder = new TLcdASDIModelDecoder();
ILcdModel model = decoder.decode( "asdi_data.asdi" );
Performance tips
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models are thread-safe for read access.
Supported versions
- This decoder supports version 5.4 of the ASDI standard.
-
Constructor Summary
ConstructorDescriptionCreates aTLcdASDIModelDecoder
, a model decoder for decoding ASDI data. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Returns the input stream factory that is currently used for creating input streams given source names.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.Methods inherited from class com.luciad.format.asdi.ALcdASDIDecoder
getMessageFilter, getStartTime, setMessageFilter, setStartTime
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
-
Constructor Details
-
TLcdASDIModelDecoder
public TLcdASDIModelDecoder()Creates aTLcdASDIModelDecoder
, a model decoder for decoding ASDI data.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is currently used for creating input streams given source names.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is currently used.
-
getDisplayName
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
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
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:
-