Class TLcdCADRGDirectoryModelDecoder

java.lang.Object
com.luciad.format.cadrg.TLcdCADRGDirectoryModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

public class TLcdCADRGDirectoryModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes directories containing rasters in the CADRG format (Compressed ARC Digital Raster Graphics). When your CADRG data set comes with a TOC file, it is recommended to decode that TOC file using the TLcdCADRGModelDecoder instead of using this decoder.

Input files

File Required Entry point Description
*.GN[1-9] x
Global Navigation Chart (GNC), 1:5000000
*.JN[1-9]
Jet Navigation Chart (JNC), 1:2000000
*.ON[1-9]
Operational Navigation Chart (ONC), 1:1000000
*.TP[1-9]
Tactical Pilotage Chart (TPC), 1:500000
*.LF[1-9]
Low Flying Chart (UK) (LFC), 1:500000
*.JG[1-9]
Joint Operations Graphic (JOG), 1:250000
*.JA[1-9]
Joint Operations Graphic - Air (JOG-A), 1:250000
*.JR[1-9]
Joint Operations Graphic - Radar (JOG-R), 1:250000
*.TF[1-9]
Transit Flying Chart (UK) (TFC), 1:250000
*.AT[1-9]
Series 200 Air Target Chart (ATC), 1:200000
*.TC[1-9]
Topographic Line Map (TLM 100), 1:100000
*.TL[1-9]
Topographic Line Map (TLM 50), 1:50000

Supported file transfer protocols

  • This model decoder only decodes data from a file system.

Model structure

  • This model decoder creates a model per raster data set.
  • All models returned by this model decoder implement ILcd2DBoundsIndexedModel.

Model descriptor

Model reference

  • All models returned by this model decoder have instances of ILcdGeodeticReference as model references.
  • The geodetic datum of this reference is an ellipsoidal datum WGS84.

Model elements

Useful settings

  • By default, the decoder will produce tiles with IndexColorModel instances. By setting the property expandColorMap, the color maps will be expanded to full ARGB DirectColorModel instances, in order to avoid problems with clashing color maps from different CADRG tiles (cfr. MIL-C-89038, Section 3.10.3 "Color reduction").
  • The property createMultilevelRasters allows to decode ILcdMultilevelRaster elements instead of simple ILcdRaster elements.

Sample code


 ILcdModelDecoder decoder =
   new TLcdCADRGDirectoryModelDecoder(TLcdSharedBuffer.getBufferInstance(), true, true);

 ILcdModel model = decoder.decode("CADRG_Data_Directory");
 

Performance tips

  • Not expanding color maps (property expandColorMap) is generally somewhat more efficient for painting the rasters, but it may cause some color artifacts for data sets that don't have uniform color maps.
  • Creating multilevel rasters (property createMultilevelRasters) can help avoiding picking the right level of detail when painting them. Rasters that are defined at different levels of detail will not be painted at the same time, which is generally unnecessary for overlapping rasters.

Thread safety

  • The decoding of models is thread-safe, as long as no properties are changed during the decoding.
  • The decoded models and elements are thread-safe for read access, on the condition that a thread-safe buffer is used.

Supported versions and specifications

  • Compressed ARC Digitized Raster Graphics (CADRG, MIL-C-89038, 6 October 1994)
  • Compressed ARC Digitized Raster Graphics (CADRG, MIL-PRF-89038, 6 October 1994)
  • Controlled Image Base (CIB, MIL-C-89041, 15 May 1995)
  • Controlled Image Base (CIB, MIL-PRF-89041, 15 May 1995)
  • Raster Product Format (MIL-STD-2411, 6 October 1994)
  • Integration of Raster Product Format Files into the National Imagery Transmission Format (MIL-STD-2411-2, 26 August 1994)
  • Registered Data Values for Raster Product Format (MIL-STD-2411-1, 30 August 1994)

Known limitations

  • Polar frames are currently ignored.
  • The TLcdCADRGBoundaryRectangleDescriptors of the decoded TLcdCADRGRasters do not provide the information that is stored inside the frame files: ProductDataType is always "CADRG" and CompressionRatio is always "VAR". The other information (Scale, Zone, ProducerCode, HorizontalResolution, and VerticalResolution) is filled out.
  • Because the bounds and tile size of the decoded rasters are computed based on the frame file names, they may be slightly different than those recorded in the A.TOC or the frame files. The difference is no greater than the 16th decimal position (machine precision) of the raster coordinates, but it may still be visible as a small image shift when comparing to the models decoded by TLcdCADRGModelDecoder.
Since:
7.2.02
  • Field Details

  • Constructor Details

    • TLcdCADRGDirectoryModelDecoder

      public TLcdCADRGDirectoryModelDecoder()
      Creates a new TLcdCADRGDirectoryModelDecoder, with a globally shared buffer for caching tiles.
      See Also:
    • TLcdCADRGDirectoryModelDecoder

      public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer)
      Creates a new TLcdCADRGDirectoryModelDecoder.
      Parameters:
      aBuffer - the buffer in which pixel data can be decoded and cached.
    • TLcdCADRGDirectoryModelDecoder

      public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap)
      Creates a new TLcdCADRGDirectoryModelDecoder.
      Parameters:
      aBuffer - the buffer in which pixel data can be decoded and cached.
      aExpandColorMap - specifies whether the color maps of decoded tiles should be expanded.
    • TLcdCADRGDirectoryModelDecoder

      public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap, boolean aCreateMultilevelRasters)
      Creates a new TLcdCADRGDirectoryModelDecoder.
      Parameters:
      aBuffer - the buffer in which pixel data can be decoded and cached.
      aExpandColorMap - specifies whether the color maps of decoded tiles should be expanded.
      aCreateMultilevelRasters - specifies whether the decoder should create multilevel rasters instead of ordinary rasters
  • Method Details

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • setReadTableOfContentsFiles

      public void setReadTableOfContentsFiles(boolean aReadTableOfContentsFiles)
      Sets whether any A.TOC files that are encountered should be read and interpreted. Otherwise, the decoder will descend in the subdirectories to find the individual frame files. Interpreting the A.TOC files is generally faster, but it assumes they are up to date with the frame files that are available. The default is true.
    • isReadTableOfContentsFiles

      public boolean isReadTableOfContentsFiles()
      Returns whether any A.TOC files that are encountered are read and interpreted.
    • setExpandColorMap

      public void setExpandColorMap(boolean aExpandColorMap)
      Sets whether the color maps of decoded tiles should be expanded.
    • isExpandColorMap

      public boolean isExpandColorMap()
      Returns whether the color maps of decoded tiles are expanded. The default is false.
    • setCreateMultilevelRasters

      public void setCreateMultilevelRasters(boolean aCreateMultilevelRasters)
      Specifies whether decoded models should contain multilevel rasters, one for each CADRG zone, or just regular rasters. The default is false.
    • isCreateMultilevelRasters

      public boolean isCreateMultilevelRasters()
      Returns whether decoded models contain multilevel rasters, one for each CADRG zone, or just regular rasters. The default is false.
      Returns:
      true if multilevel rasters are created, false if regular rasters are created.
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Checks whether the given source name is a directory.
      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Parses a directory recursively and assembles all the CADRG frame files that are found as a model containing rasters or multilevel rasters.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - a directory name.
      Returns:
      a model containing rasters or multilevel rasters.
      Throws:
      IOException
      See Also: