This guide shows how to decode DAFIF data defined according to the Edition 8 specifications.

You can recognize the DAFIF Edition 8 specific classes by the prefix DAFIFT. The extra 'T' stands for the tab-delimited record layout of this specification.

More information on the individual DAFIFT classes can be found in the reference guide in the subpackages of the com.luciad.format.dafift package. For example the package com.luciad.format.dafift.model contains more information about the DAFIFT domain model.

Similar to DAFIF, you can simply decode the data using TLcdDAFIFModelDecoder, and create a layer using TLspDAFIFLayerBuilder for Lightspeed views, or TLcdDAFIFDefaultLayerFactory for GXY views.

Preparing DAFIFT data

What does 'preparing' DAFIFT data mean?

Like DAFIF Edition 7 data files, DAFIF Edition 8 (or DAFIFT) data files can be very large. Decoding these large files is time-consuming, and unnecessary if you are interested in only a small part of it.

Therefore, the DAFIF package provides a class, TLcdDAFIFTDataPreparatorMain, that is able to divide large data files into smaller ones. This division is based on the ICAO region found in the records. The preparator class is also provided as a sample, in samples/decoder/dafif/datapreparator.

Given a directory containing one or more DAFIFT files, the TLcdDAFIFTDataPreparatorMain class will create a new directory tree, starting from the path specified in the configuration file for the data preparation.

The root of the tree contains a sub-directory for each ICAO region found in the source data. Each sub-directory contains:

  • The records containing the ICAO region of the sub-directory name, organized in files with the same names as the source files

  • A file named dafift.toc, containing the property: icao.region=< ICAO code>. This code represents the ICAO region of this data structure.

The result of running the TLcdDAFIFTDataPreparatorMain class will look like this:

  - < split _ directory >
    - AG
      - ARPT
        ACOM.TXT
        ACOM_RMK.TXT
        ...
      - BDRY
        BDRY.TXT
        BDRY_PAR.TXT
        ...
      ...
      dafift.toc
    - AN
      - ARPT
        ACOM.TXT
        ACOM_RMK.TXT
        ...
      - BDRY
        BDRY.TXT
        BDRY_PAR.TXT
        ...
      ...
      dafift.toc
    ...
    dafift.toc

How to prepare DAFIFT data?

To prepare the DAFIF Edition 8 data, the DAFIFT data preparator needs a configuration file. You must specify the path to the configuration file as a program parameter when running the TLcdDAFIFTDataPreparatorMain. The configuration file must contain the following attributes:

  • filechooser_initial_directory: specifies the base directory for the file chooser. It will be used to choose the source directory. You must define either this attribute, or the fullall_directory attribute.

  • fullall_directory: specifies the path to the source directory. Define either this attribute, or the filechooser_initial_directory attribute.

  • split_directory: specifies the top directory for the result of the splitting process.

Decoding DAFIFT data

The TLcdDAFIFModelDecoder can decode a single DAFIFT file, ARPT/ARPT.TXT for example. It can also handle a directory that contains DAFIFT files: it creates a model tree node with a model for each file.

If you need more control over the decoding, such as filtering, you can use one of the decoders for specific types. These decoder classes are located in the package com.luciad.format.dafift.decoder.

The following decoders are currently provided in the decoder sub-package:

Some of these decoders require that a number of models are set on the decoder before decoding can start. The reason for this is that an ATS route, for instance, refers to a number waypoints which must be known during the decode process.

For these decoders, extensions that do not require such models to be set beforehand, are available. They have the prefix Independent in their names. These independent decoders will decode any necessary data, such as waypoints, before starting to decode themselves. The following independent decoders are provided:

When a DAFIFT file is decoded successfully, the specific decoder returns an ILcdModel containing the decoded objects. Note that the types of these objects are the same as the types of objects created with the DAFIF Edition 7 decoders.

Filtering DAFIFT data

DAFIF Edition 8 data can be filtered in three ways:

The ILcdBounds filter

By calling the setDecodingBounds method on a DAFIFT model decoder, you can specify filter bounds. When decoding a DAFIFT data file with the configured DAFIFT decoder, this decoder will only put an object in the resulting model if the bounds of the object interact with the specified bounds. If no bounds are specified on a decoder, all objects will be inserted into the model.

The ILcdDAFIFModelFilter

You can specify an ILcdDAFIFModelFilter by calling the setModelFilter method on the DAFIFT model decoder. When decoding a DAFIFT data file with the configured DAFIFT decoder, this decoder will only put an object in the resulting model if the object passes through the specified filter. If no ILcdDAFIFModelFilter is specified on a decoder, all objects will be inserted into the model.

The ILcdDAFIFTRecordFilter

You can specify an ILcdDAFIFTRecordFilter by calling the setRecordFilter method on the DAFIFT model decoder. When decoding a DAFIFT data file with the configured DAFIFT decoder, this decoder will only handle records that pass through the specified filter. If no ILcdDAFIFTRecordFilter is specified on a decoder, all records will be handled. If a record is not handled, the corresponding object cannot be created, and can therefore not be added to model.