@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdDIMAPModelDecoder extends 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
of this decoder. The input stream factory must produce a SeekableStream
for the
image file.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 String |
DIM_EXTENSION |
static 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(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getImageInputStreamFactory()
Deprecated.
This method simply returns the result of
getInputStreamFactory() now. Please call
getInputStreamFactory() directly instead. In the next major release, this method will be removed. |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
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 ignored)
Deprecated.
Calls to this method are ignored. Please call
setInputStreamFactory(com.luciad.io.ILcdInputStreamFactory) instead, which is now
used for all input streams created by this decoder. In the next major release, this method will be removed. |
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams.
|
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 String DISPLAY_NAME
public static final 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)
SeekableStream
instances for the image file in order for JAI to be able to use them.setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
@Deprecated public void setImageInputStreamFactory(ILcdInputStreamFactory ignored)
setInputStreamFactory(com.luciad.io.ILcdInputStreamFactory)
instead, which is now
used for all input streams created by this decoder. In the next major release, this method will be removed.@Deprecated public ILcdInputStreamFactory getImageInputStreamFactory()
getInputStreamFactory()
now. Please call
getInputStreamFactory()
directly instead. In the next major release, this method will be removed.getInputStreamFactory()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
ILcdModelDecoder
true
for a source name while decode
throws 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.
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
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.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);
}
}
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)