@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdDIMAPModelDecoder extends java.lang.Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
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 |
inputStreamFactory
and the
imageInputStreamFactory
of this decoder. The
imageInputStreamFactory
must produce a
SeekableStream
.ILcd2DBoundsIndexedModel
.TLcdDIMAPModelDescriptor
.ALcdImage
(and ILcdRaster
) instance.minimumTiePointCount
,
allowOrthographicReferencing
, and
maximumResidualTiePointError
provide some control over the
model reference system that is created and the minimal accuracy that is
required.
ILcdModelDecoder decoder = new TLcdDIMAPModelDecoder();
ILcdModel model = decoder.decode("METADATA.DIM");
TLcdGeoTIFFModelEncoder
can create compressed
multilevel GeoTIFF files that can replace the original DIMAP files.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DIM_EXTENSION |
static java.lang.String |
DISPLAY_NAME |
static double |
EPSILON |
Constructor and Description |
---|
TLcdDIMAPModelDecoder()
Creates a new TLcdDIMAPModelDecoder, with a globally shared buffer for
caching any DTED raster tiles.
|
TLcdDIMAPModelDecoder(ILcdBuffer aBuffer)
Creates a new TLcdDIMAPModelDecoder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(java.lang.String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(java.lang.String aSourceName)
Creates a new model from the given data source.
|
java.lang.String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getImageInputStreamFactory()
Returns the factory that creates the input streams for decoding GeoTIFF
images.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is creates the input streams for
decoding DIMAP metadata.
|
double |
getMaximumResidualTiePointError()
Returns the maximum acceptable average residual error for tie points.
|
int |
getMinimumTiePointCount()
Returns the minimum number of tie points required for positioning image
files that provide tie points.
|
ILcdRasterReferencer |
getRasterReferencer()
Returns the raster referencer that is used when positioning image files
based on tie points.
|
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.
|
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.
|
void |
setImageInputStreamFactory(ILcdInputStreamFactory aImageInputStreamFactory)
Sets the factory that will create the input streams from which GeoTIFF
images can be decoded.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams
for decoding DIMAP metadata.
|
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.
|
void |
setMinimumTiePointCount(int aMinimumTiePointCount)
Sets the minimum number of tie points required for positioning rasters
that provide tie points instead of scaling information.
|
void |
setRasterReferencer(ILcdRasterReferencer aRasterReferencer)
Sets the raster referencer that will be used when positioning image files
based on tie points.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final java.lang.String DISPLAY_NAME
public static final java.lang.String DIM_EXTENSION
public static final double EPSILON
public TLcdDIMAPModelDecoder()
TLcdSharedBuffer.getBufferInstance()
public TLcdDIMAPModelDecoder(ILcdBuffer aBuffer)
aBuffer
- the buffer in which any decoded DTED raster tiles will be
cached.public void setMinimumTiePointCount(int aMinimumTiePointCount)
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.
aMinimumTiePointCount
- the minimum number of tie points.setAllowOrthographicReferencing(boolean)
,
setMaximumResidualTiePointError(double)
public int getMinimumTiePointCount()
public void setAllowOrthographicReferencing(boolean aAllowOrthographicReferencing)
true
.public boolean isAllowOrthographicReferencing()
public void setMaximumResidualTiePointError(double aMaximumResidualTiePointError)
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
.
aMaximumResidualTiePointError
- the maximum residual error, expressed
in pixels.setMinimumTiePointCount(int)
public double getMaximumResidualTiePointError()
public void setRasterReferencer(ILcdRasterReferencer aRasterReferencer)
minimumTiePointCount
, allowOrthographicReferencing
,
and maximumResidualTiePointError
, which are used by default.aRasterReferencer
- the raster referencer, which will create model
references and raster bounds based on tie points.public ILcdRasterReferencer getRasterReferencer()
public 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 setImageInputStreamFactory(ILcdInputStreamFactory aImageInputStreamFactory)
javax.media.jai.codec.SeekableStream
instances,
in order for JAI to be able to use them.public ILcdInputStreamFactory getImageInputStreamFactory()
public java.lang.String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(java.lang.String aSourceName)
ILcdModelDecoder
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.public ILcdModel decode(java.lang.String aSourceName) throws java.io.IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aSourceName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.java.io.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);
}
}
java.io.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.