Package com.luciad.format.cadrg
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
- All models returned by this model decoder have a
TLcdCADRGModelDescriptoror aTLcdCADRGMultilevelRasterModelDescriptor, depending on the propertycreateMultilevelRasters. - 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 either
TLcdCADRGRasterelements, orILcdMultilevelRasterelements containingTLcdCADRGRasterinstances, depending on the propertycreateMultilevelRasters.
Useful settings
- By default, the decoder will produce tiles with
IndexColorModelinstances. By setting the propertyexpandColorMap, the color maps will be expanded to full ARGBDirectColorModelinstances, 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
createMultilevelRastersallows to decodeILcdMultilevelRasterelements instead of simpleILcdRasterelements.
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 decodedTLcdCADRGRasters do not provide the information that is stored inside the frame files:ProductDataTypeis always "CADRG" andCompressionRatiois 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.TOCor 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 byTLcdCADRGModelDecoder.
- Since:
- 7.2.02
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdCADRGDirectoryModelDecoder, with a globally shared buffer for caching tiles.TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer) Creates a newTLcdCADRGDirectoryModelDecoder.TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap) Creates a newTLcdCADRGDirectoryModelDecoder.TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap, boolean aCreateMultilevelRasters) Creates a newTLcdCADRGDirectoryModelDecoder. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether the given source name is a directory.Parses a directory recursively and assembles all the CADRG frame files that are found as a model containing rasters or multilevel rasters.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used for creating input streams given source names.booleanReturns whether decoded models contain multilevel rasters, one for each CADRG zone, or just regular rasters.booleanReturns whether the color maps of decoded tiles are expanded.booleanReturns whether any A.TOC files that are encountered are read and interpreted.voidsetCreateMultilevelRasters(boolean aCreateMultilevelRasters) Specifies whether decoded models should contain multilevel rasters, one for each CADRG zone, or just regular rasters.voidsetExpandColorMap(boolean aExpandColorMap) Sets whether the color maps of decoded tiles should be expanded.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.voidsetReadTableOfContentsFiles(boolean aReadTableOfContentsFiles) Sets whether any A.TOC files that are encountered should be read and interpreted.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
-
TLcdCADRGDirectoryModelDecoder
public TLcdCADRGDirectoryModelDecoder()Creates a newTLcdCADRGDirectoryModelDecoder, with a globally shared buffer for caching tiles.- See Also:
-
TLcdCADRGDirectoryModelDecoder
Creates a newTLcdCADRGDirectoryModelDecoder.- Parameters:
aBuffer- the buffer in which pixel data can be decoded and cached.
-
TLcdCADRGDirectoryModelDecoder
Creates a newTLcdCADRGDirectoryModelDecoder.- 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 newTLcdCADRGDirectoryModelDecoder.- 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
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is used for creating input streams given source names.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- 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
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
Checks whether the given source name is a directory.- 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
Parses a directory recursively and assembles all the CADRG frame files that are found as a model containing rasters or multilevel rasters.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- a directory name.- Returns:
- a model containing rasters or multilevel rasters.
- Throws:
IOException- See Also:
-