public class TLcdCADRGDirectoryModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
TOC
file,
it is recommended to decode that TOC
file using the TLcdCADRGModelDecoder
instead of using this decoder.
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 |
ILcd2DBoundsIndexedModel
.TLcdCADRGModelDescriptor
or a
TLcdCADRGMultilevelRasterModelDescriptor
, depending on the
property createMultilevelRasters
.ILcdGeodeticReference
as model references.TLcdCADRGRaster
elements,
or ILcdMultilevelRaster
elements containing TLcdCADRGRaster
instances, depending on the property
createMultilevelRasters
.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").createMultilevelRasters
allows to decode
ILcdMultilevelRaster
elements instead of simple
ILcdRaster
elements.
ILcdModelDecoder decoder =
new TLcdCADRGDirectoryModelDecoder(TLcdSharedBuffer.getBufferInstance(), true, true);
ILcdModel model = decoder.decode("CADRG_Data_Directory");
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.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.TLcdCADRGBoundaryRectangleDescriptor
s of the decoded
TLcdCADRGRaster
s 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.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
.
Modifier and Type | Field and Description |
---|---|
static String |
DISPLAY_NAME |
Constructor and Description |
---|
TLcdCADRGDirectoryModelDecoder()
Creates a new
TLcdCADRGDirectoryModelDecoder , with a globally shared
buffer for caching tiles. |
TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer)
Creates a new
TLcdCADRGDirectoryModelDecoder . |
TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer,
boolean aExpandColorMap)
Creates a new
TLcdCADRGDirectoryModelDecoder . |
TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer,
boolean aExpandColorMap,
boolean aCreateMultilevelRasters)
Creates a new
TLcdCADRGDirectoryModelDecoder . |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether the given source name is a directory.
|
ILcdModel |
decode(String aSourceName)
Parses a directory recursively and assembles all the CADRG frame files that
are found as a model containing rasters or multilevel rasters.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used for creating input streams
given source names.
|
boolean |
isCreateMultilevelRasters()
Returns whether decoded models contain multilevel rasters, one for each
CADRG zone, or just regular rasters.
|
boolean |
isExpandColorMap()
Returns whether the color maps of decoded tiles are expanded.
|
boolean |
isReadTableOfContentsFiles()
Returns whether any A.TOC files that are encountered are read and
interpreted.
|
void |
setCreateMultilevelRasters(boolean aCreateMultilevelRasters)
Specifies whether decoded models should contain multilevel rasters, one
for each CADRG zone, or just regular rasters.
|
void |
setExpandColorMap(boolean aExpandColorMap)
Sets whether the color maps of decoded tiles should be expanded.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams
given source names.
|
void |
setReadTableOfContentsFiles(boolean aReadTableOfContentsFiles)
Sets whether any A.TOC files that are encountered should be read and
interpreted.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String DISPLAY_NAME
public TLcdCADRGDirectoryModelDecoder()
TLcdCADRGDirectoryModelDecoder
, with a globally shared
buffer for caching tiles.TLcdSharedBuffer.getBufferInstance()
public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer)
TLcdCADRGDirectoryModelDecoder
.aBuffer
- the buffer in which pixel data can be decoded and cached.public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap)
TLcdCADRGDirectoryModelDecoder
.aBuffer
- the buffer in which pixel data can be decoded and cached.aExpandColorMap
- specifies whether the color maps of decoded
tiles should be expanded.public TLcdCADRGDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aExpandColorMap, boolean aCreateMultilevelRasters)
TLcdCADRGDirectoryModelDecoder
.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
rasterspublic void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public void setReadTableOfContentsFiles(boolean aReadTableOfContentsFiles)
public boolean isReadTableOfContentsFiles()
public void setExpandColorMap(boolean aExpandColorMap)
public boolean isExpandColorMap()
public void setCreateMultilevelRasters(boolean aCreateMultilevelRasters)
public boolean isCreateMultilevelRasters()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
decode
in interface ILcdModelDecoder
aSourceName
- a directory name.IOException
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)