The DTED file reader

You can use the DTED® file reader to read Digital Terrain Elevation Data (DTED format) files. The DTED read format is a map format for representing terrain elevations published by the U.S. National Imagery and Mapping Agency (NIMA). The DTED files contain digital terrain models as rasters. A raster is a georeferenced grid containing a value in each of its cells. In the case of DTED, and a digital terrain model in general, the value indicates the average elevation in the cell. However, this value can indicate any other attribute: surface temperature, surface pressure, nitrogen rating of the soil, and so on.
The DTED reader provided in this package is based on the specification document MIL-PRF-89020A of 19 April 1996. DTED files are available with various precision levels, called DTED0, DTED1, and DTED2. A DTED file contains a digital terrain model raster that covers a zone of one degree by one degree. The cell size of the raster depends on the DTED level:
  • DTED0 provides raw data (approximately 30 to 40 KB for a file).
  • DTED1 provides data that is more detailed.
  • DTED2 is the most precise level. It has surface cells that are nine times smaller than those of DTED1. At this degree of precision, a DTED file is enormous (several megabytes).
The complete source code for a DTED demonstration can be found at

The DTED raster reader

The following code shows how to use an IlvRasterDTEDReader to load a single DTED file using the IlvMapDataSource:
IlvRasterDTEDReader r = new IlvRasterDTEDReader();
try {
  r.addMap(filename);
} catch (IOException e1) {
  e1.printStackTrace();
}
IlvMapDataSource source = 
IlvRasterDataSourceFactory.buildImageDataSource(manager, r, null);
try {
  source.start();
} catch (Exception e) {
  e.printStackTrace();
}
The following code shows how to read a set of DTED files using an IlvTiledRasterDataSource. This produces an IlvMapLayer containing an IlvTiledLayer holding the tiles.
IlvRasterDTEDReader r = new IlvRasterDTEDReader();
try {
  r.addMap(filename);
} catch (IOException e) {
  e.printStackTrace();
}
IlvMapDataSource source = 
IlvRasterDataSourceFactory.buildTiledImageDataSource(manager, r, true, true, null);
try {
  source.start();
} catch (Exception e) {
  e.printStackTrace();
}

Classes for reading the DTED format

The main class for reading DTED formats is IlvDTEDReader. This class implements the IlvMapFeatureIterator interface and returns only one IlvMapFeature object, which is the raster corresponding to the digital terrain model (DTM) stored in the file. The geometry of this map feature is of type IlvMapRaster. The map feature has no attribute. The projection of the reader is the source projection of the DTED data, that is, the geographic projection.
The IlvDTEDLayer class defines load-on-demand for the DTED format. Load-on-demand is implemented on a DTED-level basis from the corresponding file name or URL. In other words, the size of a tile in a JViews Maps tiled layer corresponds to the size of a DTED tile. This specific implementation of load-on-demand works exclusively with maps drawn with the geographic projection. Specifying a URL allows you to access one of the NIMA CDs directly from their website. For an example, see the DTED demonstration at the following location: