@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdMrSIDModelDecoder extends Object implements ILcdModelDecoder
File | Required | Entry point | Description |
---|---|---|---|
*.sid | x | x | MrSID file containing the raster data and possibly specifying a model reference and raster bounds using embedded GeoTIFF tags |
*.tab | TAB file specifying a model reference and raster bounds | ||
*.sdw | SDW file specifying raster bounds |
If none of these files specify a model reference, the model reference is obtained from an ILcdModelReferenceDecoder
. The default reference decoder set on this
model decoder is based on all model reference decoders annotated with the LcdService
annotation, and can handle
<filename>.epsg
): see TLcdEPSGModelReferenceDecoder
for more info.<filename>.prj
): see TLcdWKTModelReferenceDecoder
for more info.<filename>.ref
): see TLcdModelReferenceDecoder
for more info.
If none of the files specify raster bounds, it is retrieved from the
bounds
property of this decoder.
InputStream
, from a http connection or from an image file inside
a jar file.
ILcd2DBoundsIndexedModel
.TLcdMrSIDModelDescriptor
.default reference
for files from which the reference information is mssing.custom reference decoder
can also be installed.ALcdImage
(and ILcdMultilevelRaster
) instance.defaultValue
allows the specify the
default value that is assigned to decoded rasters.
ILcdModelDecoder decoder = new TLcdMrSIDModelDecoder();
ILcdModel model = decoder.decode("raster.sid");
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DISPLAY_NAME |
static double |
EPSILON |
Constructor and Description |
---|
TLcdMrSIDModelDecoder()
Creates a new TLcdMrSIDModelDecoder, with a globally shared buffer for
caching pixel data.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer)
Creates a new TLcdMrSIDModelDecoder with the given buffer.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer,
ILcdModelReference aDefaultModelReference)
Creates a new TLcdMrSIDModelDecoder with the given buffer and default
model reference.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer,
ILcdModelReferenceDecoder aModelReferenceDecoder)
Creates a new TLcdMrSIDModelDecoder with the given buffer and model
reference decoder.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer,
ILcdModelReferenceDecoder aModelReferenceDecoder,
ILcdModelReference aDefaultModelReference,
int aDefaultValue)
Creates a new TLcdMrSIDModelDecoder with the given properties.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer,
ILcdModelReferenceDecoder aModelReferenceDecoder,
int aDefaultValue)
Creates a new TLcdMrSIDModelDecoder with the given buffer, model
reference decoder, and default value.
|
TLcdMrSIDModelDecoder(ILcdBuffer aBuffer,
ILcdModelReference aDefaultModelReference,
int aDefaultValue)
Creates a new TLcdMrSIDModelDecoder with the given buffer, default
model reference, and default value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether
TLcdMrSIDModelDecoder can decode the given data. |
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
ILcdBounds |
getBounds()
Sets the default model bounds that is assigned to rasters of the
decoded models whose image files don't specify bounds.
|
ILcdModelReference |
getDefaultModelReference()
Returns the default model reference that is assigned to decoded models
whose image files don't specify model references.
|
int |
getDefaultValue()
Returns the default pixel value that is assigned to the rasters of the
decoded models.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
double |
getMaximumResidualTiePointError()
Returns the maximum acceptable average residual error for tie points.
|
ILcdModelReference |
getModelReference()
Deprecated.
|
ILcdModelReferenceDecoder |
getModelReferenceDecoder()
Returns the model reference decoder that is used for decoded models
whose image files don't specify model references.
|
void |
setBounds(ILcdBounds aBounds)
Sets the default model bounds that will be assigned to rasters of the
decoded models whose image files don't specify bounds.
|
void |
setDefaultModelReference(ILcdModelReference aDefaultModelReference)
Sets the default model reference that will be assigned to decoded models
whose image files don't specify model references.
|
void |
setDefaultValue(int aDefaultValue)
Sets the default pixel value that will be assigned to the rasters of the
decoded models.
|
void |
setMaximumResidualTiePointError(double aMaximumResidualTiePointError)
Sets the maximum acceptable average residual error for tie points, when
positioning rasters based TAB files instead of on scaling information.
|
void |
setModelReference(ILcdModelReference aDefaultModelReference)
Deprecated.
|
void |
setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
Sets the model reference decoder that will be used for decoded models
whose image files don't specify model references.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String DEFAULT_DISPLAY_NAME
public static final double EPSILON
public TLcdMrSIDModelDecoder()
TLcdSharedBuffer.getBufferInstance()
public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer)
aBuffer
- the buffer in which pixel data can be decoded and cached.public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder)
aBuffer
- the buffer in which pixel data can be decoded and cached.aModelReferenceDecoder
- the model reference decoder.public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder, int aDefaultValue)
aBuffer
- the buffer in which pixel data can be decoded and cached.aModelReferenceDecoder
- the model reference decoder.aDefaultValue
- the default pixel value.public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReference aDefaultModelReference)
aBuffer
- the buffer in which pixel data can be decoded and cached.aDefaultModelReference
- the default model reference.public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReference aDefaultModelReference, int aDefaultValue)
aBuffer
- the buffer in which pixel data can be decoded and cached.aDefaultModelReference
- the default model reference.aDefaultValue
- the default pixel value.public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder, ILcdModelReference aDefaultModelReference, int aDefaultValue)
aBuffer
- the buffer in which pixel data can be decoded and cached.aModelReferenceDecoder
- the model reference decoder.aDefaultModelReference
- the default model reference.aDefaultValue
- the default pixel value.public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
aModelReferenceDecoder
- the model reference decoder.public ILcdModelReferenceDecoder getModelReferenceDecoder()
setModelReferenceDecoder(com.luciad.model.ILcdModelReferenceDecoder)
public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
aDefaultModelReference
- the default model reference.public ILcdModelReference getDefaultModelReference()
@Deprecated public void setModelReference(ILcdModelReference aDefaultModelReference)
setDefaultModelReference(ILcdModelReference)
.@Deprecated public ILcdModelReference getModelReference()
getDefaultModelReference()
.public void setBounds(ILcdBounds aBounds)
aBounds
- the default model bounds.public ILcdBounds getBounds()
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.public double getMaximumResidualTiePointError()
public void setDefaultValue(int aDefaultValue)
aDefaultValue
- the default pixel value.ILcdRaster.setDefaultValue(int)
public int getDefaultValue()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
TLcdMrSIDModelDecoder
can decode the given data.
The extension of the file name should be "sid" or "sdw".canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the name of the file that is to be decoded.true
if TLcdMrSIDModelDecoder
can 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)