public class TLcdDAFIFDataPreparatorMain extends Object implements 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
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:
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 and Description |
---|
TLcdDAFIFDataPreparatorMain() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aListener)
Adds an
ILcdStatusListener , which will be triggered with
progress messages during the data preparation process. |
String |
getDecoderErrorMessages()
Returns the concatenated error messages of the different decoders used to split the DAFIF data.
|
static boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
static boolean |
isWriteBounds()
Indicates whether or not .bnd files will be generated.
|
static void |
main(String[] args)
Configures the dataPreparator and starts the data preparing
process.
|
void |
prepareData()
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. It is recommended to use the
standard Java logging framework directly.
|
static void |
setWriteBounds(boolean aWriteBounds)
Specifies whether or not .bnd files should be generated.
|
public void addStatusListener(ILcdStatusListener aListener)
ILcdStatusListener
, which will be triggered with
progress messages during the data preparation process.addStatusListener
in interface ILcdStatusSource
aListener
- an ILcdStatusListener
public void removeStatusListener(ILcdStatusListener aListener)
removeStatusListener
in interface ILcdStatusSource
aListener
- an ILcdStatusListener
public void prepareData()
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.
public void setProperties(Properties aProperties)
aProperties
- the properties object to be used during the splitting processmain(java.lang.String[])
public static boolean isTraceOn()
true
if tracing is enabled for this class.public static void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.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.public static void setWriteBounds(boolean aWriteBounds)
public static boolean isWriteBounds()
public String getDecoderErrorMessages()
prepareData
call.public static void main(String[] args)
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: