Class TLcdDAFIFDataPreparatorMain
- All Implemented Interfaces:
ILcdStatusSource
Given a directory containing one or more DAFIF files, the TLcdDAFIFDataPreparatorMain
class
will create a directory tree. The the top directory, that should be specified in the config file,
will contain a subdirectory for each ICAO region found in the source data.
Each subdirectory contains
- the records having the ICAO region mentioned in the subdirectory's name, organized in files having the same names as the source files,
- for each data file a matching .bnd file containing the bounds surrounding the data in the data file,
- a file named dafif_<ICAO region>.toc, containing the relationship between the model objects and their data file names: source.<model object name>File=<file name>
Besides reorganizing a given data set and calculating bounds, the TLcdDAFIFDataPreparatorMain
class
also writes a dafif.toc file into the top directory.
The dafif.toc
file is a properties file containing:
- ICAO.regioni=<ICAO code> i=0 .. number of ICAO regions : an enumeration of all ICAO regions (subdirectories),
- 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
Important remark:
If the TLcdDAFIFDataPreparatorMain
class is used to split data in a source directory,
it will always look for a dafif.toc file in that source directory. The dafif.toc file in the source
directory is slightly different from the one in the splitting result. It only 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 (e.g. FILE0 for aerodromes, FILE1 for helipads, ...).
In other words, if the file names in the source directory differ from the default files, there should
be a dafif.toc file specifying the right names.
Limitations of the splitter: All entities, such as waypoints and routes, are split independently. This means, for example, that when a certain route depends on waypoints not in its own ICAO region, this waypoint will not be available in the waypoint file for this region, and the affected route segments will be omitted from the route.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aListener) Adds anILcdStatusListener
, which will be triggered with progress messages during the data preparation process.Returns the concatenated error messages of the different decoders used to split the DAFIF data.static boolean
Deprecated.This method has been deprecated.static boolean
Indicates whether or not .bnd files will be generated.static void
Configures the dataPreparator and starts the data preparing process.void
Separates all DAFIF data files found in the source directory over a set of subdirectories.void
removeStatusListener
(ILcdStatusListener aListener) Removes the specified status listener.void
setProperties
(Properties aProperties) Specifies a properties object.static void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.static void
setWriteBounds
(boolean aWriteBounds) Specifies whether or not .bnd files should be generated.
-
Constructor Details
-
TLcdDAFIFDataPreparatorMain
public TLcdDAFIFDataPreparatorMain()
-
-
Method Details
-
addStatusListener
Adds anILcdStatusListener
, which will be triggered with progress messages during the data preparation process.- Specified by:
addStatusListener
in interfaceILcdStatusSource
- Parameters:
aListener
- anILcdStatusListener
-
removeStatusListener
Removes the specified status listener.- Specified by:
removeStatusListener
in interfaceILcdStatusSource
- Parameters:
aListener
- anILcdStatusListener
-
prepareData
public void prepareData()Separates all DAFIF data files found in the source directory over a set of subdirectories. Each subdirectory contains the data located in a certain ICAO region.The data in each subdirectory is organized in files like the data in the source directory (same file names are used).
In addition to data files, the subdirectories will contain .bnd files and .toc files (there is one .bnd file for each data file and only one .toc file for each subdirectory). The .bnd file contains the bounds of the matching data file. The .toc file contains the relationship between model objects and data file names.
Finally, this method will add a
dafif.toc
file in the destination directory. -
setProperties
Specifies a properties object. This properties object should contain- the source directory or a directory that can be used as initial directory of a fileChooser,
- the destination directory,
- the deviation used when calculating the bounds stored in the .bnd files.
- Parameters:
aProperties
- the properties object to be used during the splitting process- See Also:
-
isTraceOn
public static boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setTraceOn
public static void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
setWriteBounds
public static void setWriteBounds(boolean aWriteBounds) Specifies whether or not .bnd files should be generated. Defaults to true. Setting this to false results in a performance increase. -
isWriteBounds
public static boolean isWriteBounds()Indicates whether or not .bnd files will be generated. -
getDecoderErrorMessages
Returns the concatenated error messages of the different decoders used to split the DAFIF data. This message is available (and changed) after eachprepareData
call. -
main
Configures the dataPreparator and starts the data preparing process.To configure the dataPreparator, the user should specify the path to a configuration file on the command line. This configuration file should contain the following attributes:
- filechooser_initial_directory : specifies the base directory for the file chooser that will be used to choose the source directory. The user should define this attribute or the fullall_directory attribute
- fullall_directory : specifies the path to the source directory. The user should define this attribute or the filechooser_initial_directory attribute.
- 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_deviation of 1 means that the left most edge will be positioned 1 degree more to the west and the right most edge will be 1 degree more to the east. The same goes for the upper and lower edges.
-