Class TLcdDAFIFATSRouteDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder
,ILcdInputStreamFactoryCapable
,ILcdModelDecoder
- Direct Known Subclasses:
TLcdDAFIFIndependentATSRouteDecoder
ALcdDAFIFSingleModelDecoder
decodes
ATS routes from a DAFIF source file. Decoded models have as model descriptor
an instance of TLcdDAFIFATSRouteModelDescriptor
.
The objects in decoded models are based on the AIS domain objects available in com.luciad.ais.model
,
which all implement ILcdDataObject
. This interface provides a generic and
format-independent way of accessing the type and properties (features) of a domain object.
For this decoder, the type of the decoded objects is TLcdDAFIFDataTypes.ATSRoute
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFATSRouteDataProperties
.
The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
.
Next to ILcdDataObject
, the objects in decoded models also implement ILcdFeatured
,
the former interface to access the properties (features) of a domain object.
This is still fully supported, and explained in the following comments.
The setATSRouteFeaturesToBeDecoded
method and the
setATSRouteSegmentFeaturesToBeDecoded
method
allow the user to specify which DAFIF features are decoded into the featured model objects.
If no features to be decoded are specified, all features will be decoded.
The following fields (taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Seventh Edition, May 2001) are supported by the decoder. The list indicates into which feature the fields are decoded.
- IDENTIFIER: ILcdATSRouteFeature.IDENTIFIER
- DIRECTION: ILcdDAFIFATSRouteFeature.DIRECTION
- TYPE: ILcdATSRouteSegmentFeature.TYPE
- BI-DIRECTIONAL: ILcdDAFIFATSRouteSegmentFeature.BI_DIRECTIONAL
- ICAO CODE: ILcdDAFIFATSRouteSegmentFeature.ICAO_CODE
- FREQUENCY CLASS: ILcdDAFIFATSRouteSegmentFeature.FREQUENCY_CLASS
- LEVEL: ILcdATSRouteSegmentFeature.LEVEL
- STATUS: ILcdDAFIFATSRouteSegmentFeature.STATUS
- OUTBOUND MAGNETIC COURSE: ILcdDAFIFATSRouteSegmentFeature.OUTBOUND_MAGNETIC_COURSE, ILcdDAFIFATSRouteSegmentFeature.OUTBOUND_MAGNETIC_COURSE_TYPE
- DISTANCE: ILcdATSRouteSegmentFeature.DISTANCE, ILcdATSRouteSegmentFeature.DISTANCE_UNIT
- INBOUND MAGNETIC COURSE: ILcdDAFIFATSRouteSegmentFeature.INBOUND_MAGNETIC_COURSE, ILcdDAFIFATSRouteSegmentFeature.INBOUND_MAGNETIC_COURSE_TYPE
- UPPER LIMIT: ILcdDAFIFATSRouteSegmentFeature.UPPER_LIMIT, ILcdDAFIFATSRouteSegmentFeature.UPPER_LIMIT_UNIT
- LOWER LIMIT: ILcdDAFIFATSRouteSegmentFeature.LOWER_LIMIT, ILcdDAFIFATSRouteSegmentFeature.LOWER_LIMIT_UNIT
- MAXIMUM AUTHORIZED: ILcdDAFIFATSRouteSegmentFeature.MAXIMUM_AUTHORIZED_ALTITUDE, ILcdDAFIFATSRouteSegmentFeature.MAXIMUM_AUTHORIZED_ALTITUDE_UNIT
- MINIMUM ALTITUDE: ILcdDAFIFATSRouteSegmentFeature.MINIMUM_ALTITUDE, ILcdDAFIFATSRouteSegmentFeature.MINIMUM_ALTITUDE_UNIT
- CRUISE LEVEL INDICATOR: ILcdDAFIFATSRouteSegmentFeature.CRUISE_LEVEL
- REQUIRED NAVIGATION PERFORMANCE: ILcdATSRouteSegmentFeature.REQUIRED_NAVIGATION_PERFORMANCE
DAFIF decoders rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For ATS routes the key features are:
ATS routes are composed of waypoints. The TLcdDAFIFATSRouteDecoder
class does not decode
the waypoints necessary to construct the ATS routes. A waypoint model should be specified
using the setWaypointsModel
method.
To identify the waypoint objects uniquely within the waypoint model, a unique index
on the IDENTIFIER
feature and the
COUNTRY_CODE
feature should be added.
The createRequiredIndex
method can be used for this.
NOTE: The createRequiredIndex
method should be called before the
setWaypointsModel
method (and the latter should be called before
calling the decode
method of course).
- See Also:
-
Field Summary
Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount
-
Constructor Summary
ConstructorDescriptionTLcdDAFIFATSRouteDecoder
(ALcdAISObjectFactory aDomainFactory) Deprecated.TLcdDAFIFATSRouteDecoder
(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties) Deprecated.Creates a newTLcdDAFIFATSRouteDecoder
.TLcdDAFIFATSRouteDecoder
(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Creates a newTLcdDAFIFATSRouteDecoder
. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdModelDescriptor
createModelDescriptor
(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecode
method.void
Adds a unique index on the specified model of waypoints.Calls the decode method ofALcdDAFIFSingleModelDecoder
.Returns the name of the file to be decoded.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.protected final void
handleRecord
(int aFormat, char[] aRecord) Deals with one record of input.void
setATSRouteFeaturesToBeDecoded
(String[] aATSRouteFeaturesToBeDecoded) Specifies a list of features to be decoded into the ATS route model objects.void
setATSRouteSegmentFeaturesToBeDecoded
(String[] aATSRouteSegmentFeaturesToBeDecoded) Specifies a list of features to be decoded into the ATS route segments.void
setRouteDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be the ATS route display name.void
setRouteSegmentDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be the ATS route segment display name.void
setWaypointsModel
(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointsModel) Specifies a model of waypoints.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNames
Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
addErrorReport, canDecodeSource, getAltitudeType, getBearingTypeForChar, getBounds, getDAFIFProperties, getDataObjectFactory, getDecodingBounds, getDomainFactory, getErrorMessage, getInputStream, getInputStreamFactory, getLocalHorizontalDatum, getModelFilter, getRecordCount, initializeErrorMessage, isStoreOriginalReference, isTraceOn, loadCFGProperties, read, readExactValue, readFormat, readMinLength, readRecord, setBounds, setDAFIFModelFilter, setDAFIFProperties, setDataObjectFactory, setDecodingBounds, setDomainFactory, setInputStreamFactory, setStoreOriginalReference, setTraceOn, transformPointToReferenceDatumSFCT
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
-
TLcdDAFIFATSRouteDecoder
Deprecated.Creates a newTLcdDAFIFATSRouteDecoder
. The user should specify which domainFactory he or she wants to use to create the ATS routes.- Parameters:
aDomainFactory
- the factory to be used to create the ATS routes
-
TLcdDAFIFATSRouteDecoder
Creates a newTLcdDAFIFATSRouteDecoder
. The user should specify which factory he or she wants to use to create the ATS routes.- Parameters:
aFactory
- the factory to be used to create the ATS routes
-
TLcdDAFIFATSRouteDecoder
@Deprecated public TLcdDAFIFATSRouteDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties) Deprecated.Creates a newTLcdDAFIFATSRouteDecoder
.- Parameters:
aDomainFactory
- the factory to be used to create the ATS routesaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
TLcdDAFIFATSRouteDecoder
Creates a newTLcdDAFIFATSRouteDecoder
.- Parameters:
aFactory
- the factory to be used to create the ATS routesaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
-
Method Details
-
decode
Calls the decode method ofALcdDAFIFSingleModelDecoder
.Checks whether a waypoint model is set before starting the decode process. If no waypoint model is specified, an
IllegalStateException
object will be thrown.- Specified by:
decode
in interfaceILcdModelDecoder
- Overrides:
decode
in classALcdDAFIFSingleModelDecoder
- Parameters:
aSource
- either the directory containing the DAFIF source file to decode (if you did not specify a properties file in the constructor, the default file name will be used) or a .toc file containing the DAFIF properties (the data file should be in the same directory as the .toc file)- Returns:
- the model build by reading the file found with aSource
- Throws:
IOException
- if an error occurs during the reading processIllegalStateException
- if no waypoint model has been specified- See Also:
-
handleRecord
protected final void handleRecord(int aFormat, char[] aRecord) Description copied from class:ALcdDAFIFSingleModelDecoder
Deals with one record of input.- Specified by:
handleRecord
in classALcdDAFIFSingleModelDecoder
- Parameters:
aFormat
- the format of the recordaRecord
- the record
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoder
Creates and returns the model descriptor to be set on the model returned in thedecode
method.- Specified by:
createModelDescriptor
in classALcdDAFIFSingleModelDecoder
- Parameters:
aSource
- the source that will be used to decode- Returns:
- a model descriptor describing the data in the model created in the decode method
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Overrides:
getDisplayName
in classALcdDAFIFDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
getDecodeFileName
Description copied from interface:ILcdDAFIFDecoder
Returns the name of the file to be decoded.Each domain object has its own file name. This method returns the name of the data file for the domain objects decoded by this DAFIF decoder.
- Returns:
- the name of the source file
-
setWaypointsModel
Specifies a model of waypoints.Please make sure there is a unique index on this model!
- Parameters:
aWaypointsModel
- the waypoint model to be used to create the ATS routes- See Also:
-
createRequiredIndex
Adds a unique index on the specified model of waypoints.This method should be called before calling
setWaypointsModel
method.Please make sure that the following features were decoded into the model objects of the specified waypoint model:
- ILcdWayPointFeature.IDENTIFIER,
- ILcdWayPointFeature.COUNTRY_CODE.
- Parameters:
aModel
- a model containing waypoints- See Also:
-
setRouteDefaultDisplayNameIndex
public void setRouteDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the ATS route display name.- Parameters:
aIndex
- the index of the feature to be used as display name
-
setRouteSegmentDefaultDisplayNameIndex
public void setRouteSegmentDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the ATS route segment display name.- Parameters:
aIndex
- the index of the feature to be used as display name
-
setATSRouteFeaturesToBeDecoded
Specifies a list of features to be decoded into the ATS route model objects.Please make sure that the
IDENTIFIER
and theDIRECTION
feature are in your list of features to be decoded!- Parameters:
aATSRouteFeaturesToBeDecoded
- a list of features that should be decoded into the ATS route objects
-
setATSRouteSegmentFeaturesToBeDecoded
Specifies a list of features to be decoded into the ATS route segments.- Parameters:
aATSRouteSegmentFeaturesToBeDecoded
- a list of features that should be decoded into the ATS route segment objects
-