This guide shows how to decode DAFIF data defined according to the Edition 7 specifications.
More information on individual classes can be found in the javadoc under
DAFIF data files may be very large. Decoding these large files is time-consuming and unnecessary if you are interested in just a small part of it.
Therefore, DAFIF provides a class, the
TLcdDAFIFDataPreparatorMain class, which is able to divide large
data files into smaller ones. This division is based on the ICAO
region found in the records. This class is also provided as a sample, in
Given a directory containing one or more DAFIF files, the
TLcdDAFIFDataPreparatorMain class will create a new directory
tree, starting from the path specified in the configuration file for the data preparation. For more information, see How to prepare DAFIF data?.
The root of the tree will contain 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. The records are organized in files with the same names as the source files.
For each data file, a matching
.bndfile containing the bounds surrounding the data in the data file
A file named
dafif_<ICAO region>.toc, specifying the relationship between the model objects and their data file names:
source.< model object name >File=< file name>.
In addition to reorganizing a given data set and calculating bounds, the
also writes a
dafif.toc file into the top directory.The
dafif.toc file is a properties file containing:
ICAO.regioni= < ICAO region > i=0.. number of ICAO regions : an enumeration of all ICAO regions (sub-directories),
source.< model object name> File= < file name >: for each model object the name of its data file.
The result of running the
TLcdDAFIFDataPreparatorMain class will look like this:
- < split_directory > - AG FILE0 FILE0.bnd FILE2 FILE2.bnd ... dafif_AG.toc - AN FILE0 FILE0.bnd FILE2 FILE2.bnd ... dafif_AN.toc ... dafif.toc
To prepare DAFIF data, you need to check two things:
The DAFIF data preparator needs a configuration file.
The source directory may have to include a
You must specify the path to the configuration file as a program
parameter when running 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 either define this attribute, or the
fullall_directory: specifies the path to the source directory. Define either this attribute, or the
split_directory: specifies the top directory for the result of the splitting process.
bounds_deviation: specifies the number of degrees used to enlarge the bounds stored in the .bnd files in both horizontal and vertical directions. A
bounds_deviationof 1 means that the leftmost edge will be positioned 1 degree more to the west and the rightmost edge will be 1 degree more to the east. The same applies to the upper and lower edges.
AIS assumes that the DAFIF files are by default named as follows: FILE0, FILE1, FILE2, FILE3, FILE4, FILE5, FILE6, FILE7, FILE8, FILE9, FILE10, FILE11, FILE12, FILE13, FILE14 and FILE15.
If the file names in the
source directory differ from these default file names, the source
directory should contain a
.toc file. Such a
dafif.toc for example, contains the file name for each model object:
source.<model object name>File=<file name>.
If the source directory does not contain a
dafif.toc file, the
default file names for DAFIF data will be used: for example, FILE0 for
aerodromes, FILE1 for helipads, and so on.
TLcdDAFIFModelDecoder can decode a single DAFIF file,
FILE0 for example.
It can also handle a directory that contains DAFIF 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
The following decoders are currently provided in the decoder sub-package:
TLcdDAFIFATSRouteDecoder: decodes ATS routes.
TLcdDAFIFAerodromeDecoder: decodes airport and airport communications.
TLcdDAFIFAerodromeNavaidDecoder: decodes aerodrome navaids (from AIRPORT_OR_HELIPORT_NAVAID records in a DAFIF file), which form a subset of all the navaids in the DAFIF data. This decoder constructs a
TLcdModelListthat contains four sub-models (
ILcdModelinstances) with specific navaids inside: VOR, TACAN, DME, and NDB.
TLcdDAFIFAirspaceDecoder: decodes air spaces.
TLcdDAFIFHelipadDecoder: decodes helipads.
TLcdDAFIFHeliportDecoder: decodes heliport and heliport communications.
TLcdDAFIFHoldingDecoder: decodes holding patterns.
TLcdDAFIFILSDecoder: decodes instrument landing systems. This decoder constructs a
TLcdModelListthat contains four sub-models (
ILcdModelinstances) with specific objects inside: Glide path, markers, localizers, DMEs.
TLcdDAFIFMilitaryTrainingRouteDecoder: decodes military training routes.
TLcdDAFIFOrtcaDecoder: decodes off-route terrain clearance altitudes.
TLcdDAFIFParachuteJumpAreaDecoder: decodes parachute jump areas.
TLcdDAFIFRefuelingTrackDecoder: decodes refueling tracks.
TLcdDAFIFRunwayDecoder: decodes runways.
TLcdDAFIFSpecialUseAirspaceDecoder: decodes special use air spaces.
TLcdDAFIFVFRRouteDecoder: decodes VFR routes.
TLcdDAFIFWayPointDecoder: decodes waypoints.
TLcdDAFIFProcedureDecoder: decodes procedures.
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
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 DAFIF file is decoded successfully, the specific
decoder returns an
ILcdModel containing the decoded
DAFIF data can be filtered in two ways:
By calling the
setDecodingBounds method on an
ILcdDAFIFDecoder, you can specify filter bounds. When decoding a
DAFIF data file with the configured DAFIF 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.
You can specify an
ILcdDAFIFModelFilter using the
setDAFIFModelFilter of the
When decoding a DAFIF data file with the configured DAFIF decoder,
this decoder will only put an object in the resulting model, if the
object passes through the specified filter. If no
ILcdDAFIFModelFilter are specified on a decoder, all objects will
be inserted into the model.
A filter example is supplied with the sample source code. It
accepts objects with a certain feature value. You can find the source code,