Class TLcdDAFIFAirspaceDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdDAFIFSubTypeFilteringDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder

public class TLcdDAFIFAirspaceDecoder extends ALcdDAFIFAirspaceDecoder implements ILcdDAFIFSubTypeFilteringDecoder
This extension of the ALcdDAFIFAirspaceDecoder decodes airspaces from a DAFIF source file. Decoded models have as model descriptor an instance of TLcdDAFIFAirspaceModelDescriptor. If subtype filtering is enabled (via setSubTypesToDecode(int[])), the decoder will produce a TLcdModelList with a TLcdDAFIFAirspaceModelListDescriptor. Each element of this model list will contain objects of one of the selected subtypes. The number of models in the list, in other words, will equal the number of chosen subtypes.

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.Airspace, which can also be retrieved through ILcdDataObject.getDataType(). The available properties of the objects are defined in TLcdDAFIFAirspaceDataProperties. 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 setAirspaceFeaturesToBeDecoded method allows 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.

  • BOUNDARY IDENTIFICATION: ILcdDAFIFAirspaceFeature.BOUNDARY_IDENTIFICATION
  • TYPE: ILcdAirspaceFeature.TYPE
  • CLASS: ILcdDAFIFAirspaceFeature.CLASS
  • NAME: ILcdAirspaceFeature.NAME
  • ICAO CODE: ILcdDAFIFAirspaceFeature.ICAO_CODE, ILcdDAFIFAirspaceFeature.ICAO_REGION
  • CONTROLLING AUTHORITY: ILcdDAFIFAirspaceFeature.CONTROLLING_AGENCY
  • COMMUNICATIONS NAME: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_NAME
  • COMMUNICATIONS FREQUENCY 1: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY1
  • COMMUNICATIONS FREQUENCY 2: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY2
  • LEVEL: ILcdDAFIFAirspaceFeature.LEVEL
  • UPPER EFFECTIVE ALTITUDE: ILcdAirspaceFeature.UPPER_LIMIT, ILcdAirspaceFeature.UPPER_LIMIT_UNIT, ILcdAirspaceFeature.UPPER_LIMIT_REFERENCE
  • LOWER EFFECTIVE ALTITUDE: ILcdAirspaceFeature.LOWER_LIMIT, ILcdAirspaceFeature.LOWER_LIMIT_UNIT, ILcdAirspaceFeature.LOWER_LIMIT_REFERENCE
  • CLASS EXCEPTION REMARKS: ILcdDAFIFAirspaceFeature.CLASS_EXCEPTION_REMARKS
  • REQUIRED NAVIGATION PERFORMANCE: ILcdDAFIFAirspaceFeature.RNP

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 airspaces the key features are:

See Also:
  • Constructor Details

    • TLcdDAFIFAirspaceDecoder

      @Deprecated public TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory)
      Deprecated.
      Constructs a new TLcdDAFIFAirspaceDecoder object. The user should specify which domainFactory he or she wants to use to create the airspaces.
      Parameters:
      aFactory - the factory to be used to create the airspaces
    • TLcdDAFIFAirspaceDecoder

      public TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
      Constructs a new TLcdDAFIFAirspaceDecoder object. The user should specify which factory he or she wants to use to create the airspaces.
      Parameters:
      aFactory - the factory to be used to create the airspaces
    • TLcdDAFIFAirspaceDecoder

      @Deprecated public TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties)
      Deprecated.
      Creates a new TLcdDAFIFAirspaceDecoder object.
      Parameters:
      aFactory - the factory to be used to create the airspaces
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
    • TLcdDAFIFAirspaceDecoder

      public TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
      Creates a new TLcdDAFIFAirspaceDecoder object.
      Parameters:
      aFactory - the factory to be used to create the airspaces
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
  • Method Details

    • getAvailableSubTypes

      public Object[] getAvailableSubTypes()
      Get an array of enumerated values defining all subtypes of a given DAFIF feature type. Note : This array MUST NOT be modified. See setSubTypesToDecode(int[]).
      Specified by:
      getAvailableSubTypes in interface ILcdDAFIFSubTypeFilteringDecoder
      Returns:
      an array of enumerated values defining subtypes of a given DAFIF feature type.
    • setSubTypesToDecode

      public void setSubTypesToDecode(int[] aTypes)
      Set the set of airspace types to be decoded.
      Specified by:
      setSubTypesToDecode in interface ILcdDAFIFSubTypeFilteringDecoder
      Parameters:
      aTypes - an array of indices specifying which type of airspaces will be decoded. If null is passed, reset to the default types.
    • getSubTypesToDecode

      public int[] getSubTypesToDecode()
      Returns the set of airspace types to be decoded.

      By default, null is returned, indicating that all available airspace types are decoded.

      Specified by:
      getSubTypesToDecode in interface ILcdDAFIFSubTypeFilteringDecoder
      Returns:
      the set of airspace types to be decoded.
    • setDAFIFModelFilter

      public void setDAFIFModelFilter(ILcdDAFIFModelFilter aFilter)
      Description copied from interface: ILcdDAFIFDecoder
      Specifies a filter to be used while creating the model. Only model objects that pass through the filter will be in the resulting model.
      Specified by:
      setDAFIFModelFilter in interface ILcdDAFIFDecoder
      Overrides:
      setDAFIFModelFilter in class ALcdDAFIFDecoder
      Parameters:
      aFilter - an ILcdDAFIFModelFilter to filter the model objects
    • 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.
    • 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.

      Specified by:
      getDecodeFileName in interface ILcdDAFIFDecoder
      Returns:
      the name of the source file
    • createModelDescriptor

      protected ILcdModelDescriptor createModelDescriptor(String aSource)
      Description copied from class: ALcdDAFIFSingleModelDecoder
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      Specified by:
      createModelDescriptor in class ALcdDAFIFSingleModelDecoder
      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
    • decode

      public ILcdModel decode(String aSource) throws IOException
      Overwrites the decode method.

      If the traceOn property is true, this decode method will output extra trace info.

      Specified by:
      decode in interface ILcdModelDecoder
      Overrides:
      decode in class ALcdDAFIFAirspaceDecoder
      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:
    • createAirspace

      protected ILcdEditableAirspace createAirspace(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Creates and initializes an instance of an implementation of the ILcdEditableAirspace interface.
      Specified by:
      createAirspace in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to retrieve information from
    • handleRecordFmt2

      protected void handleRecordFmt2(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Deals with the information found in a record of format 02.
      Specified by:
      handleRecordFmt2 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - a record of format 02
    • readAirspaceUID

      protected String readAirspaceUID(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads the unique identifier of an airspace.

      This unique identifier may consist of one or more features. The resulting String object is a concatenation of these feature values.

      Specified by:
      readAirspaceUID in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the unique identifier of an airspace
    • readShapeFromFmt3

      protected char readShapeFromFmt3(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments shape from a record of format 03.
      Specified by:
      readShapeFromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      a character that describes the shape of the segment (circle, arc, geodesic line, ...).
    • readLon0FromFmt3

      protected double readLon0FromFmt3(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments longitude 0 from a record of format 03.

      The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.

      Specified by:
      readLon0FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the longitude of the center point of an arc or circle segment
    • readLat0FromFmt3

      protected double readLat0FromFmt3(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments latitude 0 from a record of format 03.

      The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.

      Specified by:
      readLat0FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the latitude of the center point of an arc or circle segment
    • readGeodeticLat0FromFmt4

      protected double readGeodeticLat0FromFmt4(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments geodetic latitude from a record of format 04.

      The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. WGS84.

      Specified by:
      readGeodeticLat0FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      the geodetic latitude of the center point of an arc or circle segment
      See Also:
    • readGeodeticLon0FromFmt4

      protected double readGeodeticLon0FromFmt4(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments geodetic longitude 0 from a record of format 04.

      The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. WGS84.

      Specified by:
      readGeodeticLon0FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      the geodetic longitude of the center point of an arc or circle segment
      See Also:
    • readLat1FromFmt3

      protected double readLat1FromFmt3(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments latitude 1 from a record of format 03.

      Latitude 1 is the latitude of the begin point of the segment w.r.t a user specified geodetic datum.

      Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.

      Specified by:
      readLat1FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      the latitude of the begin point of a segment
    • readLon1FromFmt3

      protected double readLon1FromFmt3(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments longitude 1 from a record of format 03.

      Longitude 1 is the longitude of the begin point of the segment w.r.t a user specified geodetic datum.

      Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.

      Specified by:
      readLon1FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      the longitude of the begin point of a segment
    • readSegmentNumber

      protected int readSegmentNumber(char[] record)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads the segment number.
      Specified by:
      readSegmentNumber in class ALcdDAFIFAirspaceDecoder
      Parameters:
      record - the record to read from
      Returns:
      the segment sequence number
    • readGeodeticLon1FromFmt3

      protected double readGeodeticLon1FromFmt3(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments geodetic longitude 1 from a aRecord of format 03.

      Geodetic longitude 1 is the longitude of the begin point of the segment w.r.t WGS84.

      Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.

      Specified by:
      readGeodeticLon1FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the geodetic longitude of the begin point of a segment
      See Also:
      • ALcdDAFIFAirspaceDecoder.readLon1(char[])
    • readGeodeticLat1FromFmt3

      protected double readGeodeticLat1FromFmt3(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads a segments geodetic latitude 1 from a aRecord of format 03.

      Latitude 1 is the latitude of the begin point of the segment w.r.t WGS84.

      Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.

      Specified by:
      readGeodeticLat1FromFmt3 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the geodetic latitude of the begin point of a segment
      See Also:
      • ALcdDAFIFAirspaceDecoder.readLat1(char[])
    • readRadius1FromFmt4

      protected float readRadius1FromFmt4(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads the radius of an arc or circle segment from a record of format 04.

      All arc and circle segments have a non-empty value for radius 1. If this field is empty or non-numeric, an exception will be thrown.

      Specified by:
      readRadius1FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the radius of an arc or circle segment
    • readRadius2FromFmt4

      protected float readRadius2FromFmt4(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads radius 2 of an arc or circle segment from a record of format 04.

      This field may be empty.

      Specified by:
      readRadius2FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      radius 2 of an arc or circle segment
    • readBearing1FromFmt4

      protected float readBearing1FromFmt4(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads bearing 1 of an arc or circle segment from a record of format 04.

      This field may be empty.

      Specified by:
      readBearing1FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      bearing 1 of an arc or circle segment
    • readBearing2FromFmt4

      protected float readBearing2FromFmt4(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads bearing 2 of an arc or circle segment from a record of format 04.

      This field may be empty.

      Specified by:
      readBearing2FromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      bearing 2 of an arc or circle segment
    • readNavaidUIDFromFmt4

      protected String readNavaidUIDFromFmt4(char[] aRecord)
      Description copied from class: ALcdDAFIFAirspaceDecoder
      Reads the unique identifier of a navaid.
      Specified by:
      readNavaidUIDFromFmt4 in class ALcdDAFIFAirspaceDecoder
      Parameters:
      aRecord - the record to read from
      Returns:
      the unique identifier of a navaid
    • setAirspaceDefaultDisplayNameIndex

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