Package com.luciad.format.ecrg
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
inputStreamFactoryof this decoder.
Model structure
- This model decoder creates a single model
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel.
Model descriptor
- All models returned by this model decoder have a
TLcdECRGModelDescriptoror aTLcdECRGMultilevelRasterModelDescriptor, depending on the contents ofTOC.xml. - The type name of the model descriptor is the display name of this decoder.
Model reference
- All models returned by this model decoder have instances of
ILcdGeodeticReferenceas model references. - The geodetic datum of this reference is an ellipsoidal datum WGS84.
Model elements
- Each decoded model contains
ALcdImageelements. These also implement eitherILcdRasterorILcdMultilevelRaster, depending on the presence of multiple scales inTOC.xml. - In both cases, the
TLcdRasterinstances correspond to the ECRG/CIB boundary rectangles. They contain additional information about the rectangles. - The
TLcdRasterinstances in turn containinstances that correspond to the individual ECRG/CIB frames. They contain additional information about the frames.TLcdECRGTile
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdECRGModelDecoder, with a globally shared buffer for caching tiles.TLcdECRGModelDecoder(ILcdBuffer aBuffer) Creates a newTLcdECRGModelDecoder. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
DISPLAY_NAME
- See Also:
-
-
Constructor Details
-
TLcdECRGModelDecoder
public TLcdECRGModelDecoder()Creates a newTLcdECRGModelDecoder, with a globally shared buffer for caching tiles.- See Also:
-
TLcdECRGModelDecoder
Creates a newTLcdECRGModelDecoder.- Parameters:
aBuffer- the buffer in which pixel data can be decoded and cached.
-
-
Method Details
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows 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:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis 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:
-