Class TLcdDIMAPModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable,ILcdModelDecoder
Input files
| File | Required | Entry point | Description |
|---|---|---|---|
| VOL_LIST.DIM | x | DIMAP volume file, referring to one or more DIMAP metadata files | |
| METADATA.DIM | x | x | DIMAP metadata file, specifying a reference system, raster location, and other metadata |
| *.TIF | x | TIFF or GeoTIFF file containing the actual raster data | |
| *.JG2/*.J2K | JPEG-2000 file containing the actual raster data | ||
| *.DT* | DTED file containing the actual raster data |
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by the
inputStreamFactoryof this decoder. The input stream factory must produce aSeekableStreamfor the image file.
Model structure
- This model decoder creates a model per DIMAP volume file or DIMAP metadata file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel.
Model descriptor
- All models returned by this model decoder have a
TLcdDIMAPModelDescriptor. - The type name of the model descriptor is the display name of this decoder.
Model elements
- Each decoded model contains one object: an
ALcdImage(andILcdRaster) instance.
Useful settings
- If the raster location is specified by means of tie points, the
properties
minimumTiePointCount,allowOrthographicReferencing, andmaximumResidualTiePointErrorprovide some control over the model reference system that is created and the minimal accuracy that is required.
Sample code
ILcdModelDecoder decoder = new TLcdDIMAPModelDecoder();
ILcdModel model = decoder.decode("METADATA.DIM");
Performance tips
- The actual DIMAP rasters are often stored in GeoTIFF files at a single
level of detail and with a planar configuration. Precomputing and
storing multiple levels of detail may speed up visualization and some
computations. The
TLcdGeoTIFFModelEncodercan create compressed multilevel GeoTIFF files that can replace the original DIMAP files.
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
- DIMAP 1.1 approved specifications, Spotimage, December 2004
Known limitations
- All rasters listed in a single DIMAP volume file must be defined in the same reference system.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TLcdDIMAPModelDecoder, with a globally shared buffer for caching any DTED raster tiles.TLcdDIMAPModelDecoder(ILcdBuffer aBuffer) Creates a new TLcdDIMAPModelDecoder. -
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.doubleReturns the maximum acceptable average residual error for tie points.intReturns the minimum number of tie points required for positioning image files that provide tie points.Returns the raster referencer that is used when positioning image files based on tie points.booleanReturns whether images that are positioned in geodetic references using tie points may be put in approximating orthographic grid references that are centered around the images.voidsetAllowOrthographicReferencing(boolean aAllowOrthographicReferencing) Specifies whether images that are positioned in geodetic references using tie points may be put in approximating orthographic grid references that are centered around the images.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams.voidsetMaximumResidualTiePointError(double aMaximumResidualTiePointError) Sets the maximum acceptable average residual error for tie points, when positioning rasters that provide tie points instead of scaling information.voidsetMinimumTiePointCount(int aMinimumTiePointCount) Sets the minimum number of tie points required for positioning rasters that provide tie points instead of scaling information.voidsetRasterReferencer(ILcdRasterReferencer aRasterReferencer) Sets the raster referencer that will be used when positioning image files based on tie points.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:
-
DIM_EXTENSION
- See Also:
-
EPSILON
public static final double EPSILON- See Also:
-
-
Constructor Details
-
TLcdDIMAPModelDecoder
public TLcdDIMAPModelDecoder()Creates a new TLcdDIMAPModelDecoder, with a globally shared buffer for caching any DTED raster tiles.- See Also:
-
TLcdDIMAPModelDecoder
Creates a new TLcdDIMAPModelDecoder.- Parameters:
aBuffer- the buffer in which any decoded DTED raster tiles will be cached.
-
-
Method Details
-
setMinimumTiePointCount
public void setMinimumTiePointCount(int aMinimumTiePointCount) Sets the minimum number of tie points required for positioning rasters that provide tie points instead of scaling information. The default is 4.A value of 3 can be used, if the assumption is made that 3 tie points always define an affine transformation (which is not strictly guaranteed by the GeoTIFF specifications).
A value of 2 can be used, if the assumption is made that 2 tie points always define an affine transformation without rotation.
- Parameters:
aMinimumTiePointCount- the minimum number of tie points.- See Also:
-
getMinimumTiePointCount
public int getMinimumTiePointCount()Returns the minimum number of tie points required for positioning image files that provide tie points. -
setAllowOrthographicReferencing
public void setAllowOrthographicReferencing(boolean aAllowOrthographicReferencing) Specifies whether images that are positioned in geodetic references using tie points may be put in approximating orthographic grid references that are centered around the images. The default istrue. -
isAllowOrthographicReferencing
public boolean isAllowOrthographicReferencing()Returns whether images that are positioned in geodetic references using tie points may be put in approximating orthographic grid references that are centered around the images. -
setMaximumResidualTiePointError
public void setMaximumResidualTiePointError(double aMaximumResidualTiePointError) Sets the maximum acceptable average residual error for tie points, when positioning rasters that provide tie points instead of scaling information.A raster is always positioned by means of an affine transformation in its coordinate system. For tie points that define an affine transformation, the residual error should therefore be 0. For tie points that define more complex, non-linear warping of the image, it will be larger than 0.
The residual error is computed in image coordinates and expressed in pixels. The default is
EPSILON.- Parameters:
aMaximumResidualTiePointError- the maximum residual error, expressed in pixels.- See Also:
-
getMaximumResidualTiePointError
public double getMaximumResidualTiePointError()Returns the maximum acceptable average residual error for tie points. -
setRasterReferencer
Sets the raster referencer that will be used when positioning image files based on tie points. If it is set, it replaces the more basic settingsminimumTiePointCount,allowOrthographicReferencing, andmaximumResidualTiePointError, which are used by default.- Parameters:
aRasterReferencer- the raster referencer, which will create model references and raster bounds based on tie points.
-
getRasterReferencer
Returns the raster referencer that is used when positioning image files based on tie points. -
setInputStreamFactory
Sets the input stream factory that will be used for creating input streams. It must createSeekableStreaminstances for the image file in order for JAI to be able to use them.- 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:
-