Class TLcdECRGModelDecoder

java.lang.Object
com.luciad.format.ecrg.TLcdECRGModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdECRGModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes rasters in the ECRG format (Enhanced Compressed Raster Graphics) and in the CIB format (Controlled Image Base).

Input files

File Required Entry point Description
TOC.xml x x Table of contents, referring to individual frame files
<ds><z> x   Individual frame file.
<ds> refers the the data series code as listed in the data series table below.
<z> refers to the ARC zone number. This is a character in the range [1-9] for the northern hemisphere or [A-HJ] for the southern hemisphere. Please refer to section 3.4 of the ADRG specification (MIL-A-89007) for more details on the ARC system.

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the inputStreamFactory of this decoder.

Model structure

  • This model decoder creates a single model
  • 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

  • Each decoded model contains ALcdImage elements. These also implement either ILcdRaster or ILcdMultilevelRaster, depending on the presence of multiple scales in TOC.xml.
  • In both cases, the TLcdRaster instances correspond to the ECRG/CIB boundary rectangles. They contain additional information about the rectangles.
  • The TLcdRaster instances in turn contain TLcdECRGTile instances that correspond to the individual ECRG/CIB frames. They contain additional information about the frames.

Sample code


 ILcdModelDecoder decoder = new TLcdECRGModelDecoder();
 ILcdModel model = decoder.decode( "TOC.xml" );
 

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

  • Enhanced Compressed Raster Graphics (ECRG, MIL-PRF-32283, 21 February 2008)

Known limitations

  • Any legend frames, overview frames, elevation frames, and polar frames in the table of contents are currently ignored.
Since:
2013.1
  • Field Details

  • Constructor Details

    • TLcdECRGModelDecoder

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

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

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Description copied from interface: ILcdInputStreamFactoryCapable
      Sets the input stream factory to be used.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Description copied from interface: ILcdInputStreamFactoryCapable
      Returns the input stream factory that is used.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • 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)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws an exception for that same source name.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.

      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
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      A model containing the decoded data. While null is allowed, implementors are advised to throw an error instead.
      Throws:
      IOException - for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.
      
         public ILcdModel decode( String aSourceName ) throws IOException {
            try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
               // Perform decoding ...
            } catch (RuntimeException e) {
               throw new IOException(e);
            }
         }
       
      See Also: