skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Readers and writers > The DAFIF reader
 
The DAFIF reader
Describes the DAFIF readers provided.
*Overview
*Indicates the packaging and reference information for the DAFIF reader.
*The IlvDAFIFReader class
*Describes the IlvDAFIFReader class.
*Using the IlvDAFIFReader class to create vector data
*Explains how to create an IlvDAFIFReader instance, define features to be read and create a default renderer.
*The IlvDAFIFDataSource class
*Describes the IlvDAFIFDataSource class.
*Using the IlvDAFIFDataSource class to create vector data
*Explains how to create a data source, connect it to the view manager and read the data.
Overview
This package contains classes for reading Digital Aeronautical Flight Information Files (see DAFIF file). The format is a numerical map format for aeronautical maps that is published by the National Geospatial Intelligence Agency. The DAFIF readers provided in this package are based on DAFIF specification Edition 8.
Basically, a DAFIF catalog covers the whole world with aeronautical data. It is composed of a root directory (DAFIFT). This root directory is divided into subdirectories, each corresponding to a specific table set (ARPT, HLPT,IR,TZ,...). These subdirectories contain the table description TXT files that make up the table set.
To find more information, you need to access the NGA NIPRNET/Extranet. To access the NGA NIPRNET/Extranet, you need additional access privileges granted by NGA. Register for access by going to https://www.extranet.nga.mil.
There are two ways of reading DAFIF data:
*Using an IlvDAFIFReader instance directly. In this case, you must write all the code required to render the DAFIF map features into graphic objects, and then add them to the manager.
*Using an IlvDAFIFDataSource. This is a convenient way of performing all the above operations at once and is more integrated with the data model of the map.
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps/samples/mapbuilder/index.html.
The IlvDAFIFReader class
This class reads DAFIF features from a specified DAFIF file or catalog. It implements the IlvMapFeatureIterator interface to iterate over the read features.
Using the IlvDAFIFReader class to create vector data
To read DAFIF features using the IlvDAFIFReader object:
1. Create an IlvDAFIFReader instance from the path of the DAFIF catalog:
 
String dafifpath = "C:/maps/dafif_0606_ed8/DAFIFT";
IlvDAFIFReader reader = new IlvDAFIFReader(dafifpath);
2. You can also limit what is read to features specified by particular tables (for further information about DAFIF tables, refer to the DAFIFT format specification). For example, to read only an ARPT table you can use:
 
reader.setFeatureClassFilter(new IlvFeatureClassInformation
   (IlvDAFIFDataSource.CODE_PROPERTY_NAME,"ARF/ARF_PAR"));
3. Create a default renderer:
 
IlvFeatureRenderer renderer = new IlvDefaultFeatureRenderer();
4. Iterate over the features, render them with an appropriate IlvFeatureRenderer, and assign them to a manager:
 
IlvMapFeature feature = reader.getNextFeature();
while(feature != null) {
  // Render map feature into graphic object.
  IlvGraphic graphic = renderer.makeGraphic(feature,null);
  // Add this object to the first layer of the manager.
  manager.addObject(graphic, 0, false);
  feature = reader.getNextFeature();
}
The IlvDAFIFDataSource class
The IlvDAFIFDataSource class provides a convenient way of creating a set of layers containing DAFIF data in a manager. You can also filter the geographic objects to be created as DAFIF data sets can be large.
Using the IlvDAFIFDataSource class to create vector data
To read DAFIF features using the IlvDAFIFDataSource: object:
1. Create an IlvDAFIFDataSource :
 
String dafifpath = " C:/maps/dafif_0606_ed8/DAFIFT";
IlvDAFIFDataSource source = new IlvDAFIFDataSource(dafifpath);
2. Connect this data source to the manager of the view:
 
source.setManager(getView().getManager());
3. Select the map features you want to read by specifying the DAFIF tables for those features (for further information about object codes, refer to the DAFIFT format specification). For example, to read only roads you can use:
 
source.setAcceptedCodeList(new String[] { "ARPT/ARPT" });
4. Start the DAFIF data source:
 
source.start();
For further information, see:
*Vector data sources, for defense-specific data sources.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.