Class TLcdDAFIFVFRRouteDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdDAFIFMultiModelDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder

public class TLcdDAFIFVFRRouteDecoder extends ALcdDAFIFMultiModelDecoder
This extension of the ALcdDAFIFMultiModelDecoder decodes VFR routes from a DAFIF source file. Decoded models have as model descriptor an instance of TLcdDAFIFVFRRouteModelListDescriptor.

The resulting modelList will contain submodels for:

  • VFR routes,
  • offset routes,
  • aerodromes for which the VFR routes serve (optional).
  • heliports for which the VFR routes serve (optional).

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 handler, the types of the decoded objects are TLcdDAFIFDataTypes.VFRRoute, TLcdDAFIFDataTypes.VFROffsetRoute and TLcdDAFIFDataTypes.VFRRoutePoint, which can also be retrieved through ILcdDataObject.getDataType(). The available properties of the objects are defined in TLcdDAFIFVFRRouteDataProperties, TLcdDAFIFVFROffsetRouteDataProperties and TLcdDAFIFVFRRoutePointDataProperties. 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.

VFR route data includes data about aerodromes and heliports, served by the VFR and offset routes. To decode the available aerodrome and heliport information as well, use the setAddAerodromes method. For the aerodromes and heliports, there is no feature selection possible; all features will be decoded.

The setVFRRouteFeaturesToBeDecoded method, the setOffsetRouteFeaturesToBeDecoded method and the setVFRRoutePointFeaturesToBeDecoded 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. VFR Arrival/Departure route fields:

  • AIRPORT/HELIPORT IDENTIFICATION: ILcdAerodromeFeature.IDENTIFICATION
  • NAME: ILcdAerodromeFeature.NAME
  • COUNTRY CODE: ILcdDAFIFAerodromeFeature.COUNTRY_CODE
  • STATE/PROVINCE CODE: ILcdDAFIFAerodromeFeature.STATE_PROVINCE_CODE
  • ICAO CODE (only if the ICAO CODE field has length 4): ILcdAerodromeFeature.ICAO_CODE
  • ICAO CODE (first two characters only): ILcdAerodromeFeature.ICAO_REGION
  • FAA/HOST COUNTRY: ILcdDAFIFAerodromeFeature.FAA_HOST_COUNTRY_IDENTIFIER
  • MAGNETIC VARIATION: ILcdAerodromeFeature.MAGNETIC_VARIATION
VFR Arrival/Departure Segment route fields:
  • AIRPORT/HELIPORT IDENTIFICATION: ILcdDAFIFVFRRouteFeature.AIRPORT_ID
  • ROUTE IDENTIFICATION: ILcdDAFIFVFRRouteFeature.ROUTE_ID
  • ROUTE NAME: ILcdDAFIFVFRRouteFeature.ROUTE_NAME
  • POINT NAME/CHECKPOINT: ILcdDAFIFVFRRoutePointFeature.POINT_NAME
  • POINT IDENTITY: ILcdDAFIFVFRRoutePointFeature.POINT_IDENTITY
  • POINT COORDINATES UTM: ILcdDAFIFVFRRoutePointFeature.UTM_COORDINATES
  • POINT TYPE: ILcdDAFIFVFRRoutePointFeature.POINT_TYPE
  • POINT SYMBOL: ILcdDAFIFVFRRoutePointFeature.POINT_SYMBOL
  • AT HELIPORT/AIRPORT: ILcdDAFIFVFRRoutePointFeature.AT_HELIPORT_AIRPORT
  • SEGMENT NAME: ILcdDAFIFVFRRoutePointFeature.SEGMENT_NAME
  • MAGNETIC COURSE: ILcdDAFIFVFRRoutePointFeature.COURSE, ILcdDAFIFVFRRoutePointFeature.COURSE_TYPE
  • PATH CODE: ILcdDAFIFVFRRoutePointFeature.PATH_CODE
  • ALTITUDE DESCRIPTION CODE: ILcdDAFIFVFRRoutePointFeature.ALTITUDE_DESCRIPTION_CODE
  • ALTITUDE: ILcdDAFIFVFRRoutePointFeature.ALTITUDE, ILcdDAFIFVFRRoutePointFeature.ALTITUDE_UNIT
  • TURN DIRECTION: ILcdDAFIFVFRRoutePointFeature.TURN_DIRECTION

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 VFR routes and offset routes the key features are:

See Also:
  • Constructor Details

    • TLcdDAFIFVFRRouteDecoder

      @Deprecated public TLcdDAFIFVFRRouteDecoder(ALcdAISObjectFactory aFactory)
      Deprecated.
      Constructs a new TLcdDAFIFVFRRouteDecoder. The isAddAerodromes property will be set to true.

      The user should specify which domainFactory he or she wants to use to create the VFR routes, the aerodromes and the heliports.

      Parameters:
      aFactory - the factory to be used to create the model objects
    • TLcdDAFIFVFRRouteDecoder

      @Deprecated public TLcdDAFIFVFRRouteDecoder(ALcdAISObjectFactory aFactory, boolean aAddAerodromes)
      Deprecated.
      Constructs a new TLcdDAFIFVFRRouteDecoder. The user should specify which domainFactory he or she wants to use to create the VFR routes, the aerodromes and the heliports (if requested).
      Parameters:
      aFactory - the factory to be used to create the model objects
      aAddAerodromes - a boolean indicating whether a submodel containing the aerodromes should be added or not
    • TLcdDAFIFVFRRouteDecoder

      @Deprecated public TLcdDAFIFVFRRouteDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties)
      Deprecated.
      Constructs a new TLcdDAFIFVFRRouteDecoder. The isAddAerodromes property will be set to true.

      The user should specify which domainFactory he or she wants to use to create the VFR routes, the aerodromes and the heliports.

      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
    • TLcdDAFIFVFRRouteDecoder

      @Deprecated public TLcdDAFIFVFRRouteDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties, boolean aAddAerodromes)
      Deprecated.
      Constructs a new TLcdDAFIFVFRRouteDecoder. The user should specify which domainFactory he or she wants to use to create the VFR routes, the aerodromes and the heliports (if requested).
      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
      aAddAerodromes - a boolean indicating whether submodels containing the aerodromes and heliports should be added or not
    • TLcdDAFIFVFRRouteDecoder

      public TLcdDAFIFVFRRouteDecoder(TLcdAISDataObjectFactory aFactory)
      Constructs a new TLcdDAFIFVFRRouteDecoder. The isAddAerodromes property will be set to true.

      The user should specify which factory he or she wants to use to create the VFR routes, the aerodromes and the heliports.

      Parameters:
      aFactory - the factory to be used to create the model objects
    • TLcdDAFIFVFRRouteDecoder

      public TLcdDAFIFVFRRouteDecoder(TLcdAISDataObjectFactory aFactory, boolean aAddAerodromes)
      Constructs a new TLcdDAFIFVFRRouteDecoder. The user should specify which factory he or she wants to use to create the VFR routes, the aerodromes and the heliports (if requested).
      Parameters:
      aFactory - the factory to be used to create the model objects
      aAddAerodromes - a boolean indicating whether a submodel containing the aerodromes should be added or not
    • TLcdDAFIFVFRRouteDecoder

      public TLcdDAFIFVFRRouteDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
      Constructs a new TLcdDAFIFVFRRouteDecoder. The isAddAerodromes property will be set to true.

      The user should specify which factory he or she wants to use to create the VFR routes, the aerodromes and the heliports.

      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
    • TLcdDAFIFVFRRouteDecoder

      public TLcdDAFIFVFRRouteDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties, boolean aAddAerodromes)
      Constructs a new TLcdDAFIFVFRRouteDecoder. The user should specify which factory he or she wants to use to create the VFR routes, the aerodromes and the heliports (if requested).
      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
      aAddAerodromes - a boolean indicating whether submodels containing the aerodromes and heliports should be added or not
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Overrides:
      getDisplayName in class ALcdDAFIFDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • decode

      public ILcdModel decode(String aSource) throws IOException
      If the isAddAerodrome property is true, the aerodrome and heliport model are decoded first. Then the decode method of the ALcdDAFIFMultiModelDecoder class will be called.

      Prints additional information to the log.

      Specified by:
      decode in interface ILcdModelDecoder
      Overrides:
      decode in class ALcdDAFIFMultiModelDecoder
      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 process
      See Also:
    • handleRecord

      protected final void handleRecord(int aFormat, char[] aRecord)
      Description copied from class: ALcdDAFIFMultiModelDecoder
      Deals with one record of input.
      Specified by:
      handleRecord in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aFormat - the format of the record
      aRecord - the record to deal with
    • createModelDescriptor

      protected ILcdModelDescriptor createModelDescriptor(int aIndex, String aSource)
      Description copied from class: ALcdDAFIFMultiModelDecoder
      Creates and returns the model descriptor to be set on the model with index aIndex in the model (i.e. in the model returned in the decode method).
      Specified by:
      createModelDescriptor in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aSource - the source to be decoded
      Returns:
      a model descriptor describing the data in the submodel at position aIndex in the model produced by this decoder
    • createModelDescriptor

      public TLcdEditableModelListDescriptor createModelDescriptor(String aSource)
      Description copied from interface: ILcdDAFIFMultiModelDecoder
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      Specified by:
      createModelDescriptor in interface ILcdDAFIFMultiModelDecoder
      Specified by:
      createModelDescriptor in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aSource - the source that will be used to build the model
      Returns:
      the model descriptor to be set on the model produced by this decoder
    • getDecodeFileName

      public String 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
    • setRouteDefaultDisplayNameIndex

      public void setRouteDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the route display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setRoutePointDefaultDisplayNameIndex

      public void setRoutePointDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the route point display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setVFRRouteFeaturesToBeDecoded

      public void setVFRRouteFeaturesToBeDecoded(String[] aVFRRouteFeaturesToBeDecoded)
      Specifies the features that should be decoded into the VFR route objects of the model that will be returned by the decode method.

      Please make sure that the AIRPORT_ID feature and the ROUTE_ID feature are in your list.

      Parameters:
      aVFRRouteFeaturesToBeDecoded - a list of features that should be decoded into the VFR route objects
    • setVFRRoutePointFeaturesToBeDecoded

      public void setVFRRoutePointFeaturesToBeDecoded(String[] aVFRRoutePointFeaturesToBeDecoded)
      Specifies the features that should be decoded into the VFR route point objects of the model that will be returned by the decode method.
      Parameters:
      aVFRRoutePointFeaturesToBeDecoded - a list of features that should be decoded into the VRF route point objects
    • setOffsetRouteFeaturesToBeDecoded

      public void setOffsetRouteFeaturesToBeDecoded(String[] aOffsetRouteFeaturesToBeDecoded)
      Specifies the features that should be decoded into the offset route objects of the model that will be returned by the decode method.

      Please make sure that the ILcdDAFIFVFRRouteFeature.AIRPORT_ID feature and the ILcdDAFIFVFRRouteFeature.ROUTE_ID feature are in your list.

      Parameters:
      aOffsetRouteFeaturesToBeDecoded - a list of features that should be decoded into the offset route objects
    • isAddAerodromes

      public boolean isAddAerodromes()
      Returns the addAerodromes property. If the addAerodromes property is true, extra submodels will be created. One model containing the aerodromes and another one containing the heliports for which a VFR route serves.

      The aerodromes and heliports in the model are retrieved from the aerodrome and the heliport model decoded by this decoder using the source to be decoded.

      Returns:
      a boolean indicating whether submodel of aerodromes and heliports should be added
      See Also:
    • setAddAerodromes

      public void setAddAerodromes(boolean aValue)
      Specifies a value for the addAerodromes property.
      Parameters:
      aValue - a boolean indicating whether submodel of aerodromes and heliports should be added
      See Also: