Class TLcdMrSIDModelDecoder
- All Implemented Interfaces:
ILcdModelDecoder
Input files
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
- EPSG references (
<filename>.epsg
): seeTLcdEPSGModelReferenceDecoder
for more info. - WKT references (
<filename>.prj
): seeTLcdWKTModelReferenceDecoder
for more info. - Luciad encoded model references (
<filename>.ref
): seeTLcdModelReferenceDecoder
for more info.
If none of the files specify raster bounds, it is retrieved from the
bounds
property of this decoder.
Supported file transfer protocols
As random access to the data is required, this decoder only reads from files. So it can for example not read from anInputStream
, from a http connection or from an image file inside
a jar file.
Model structure
- This model decoder creates a model per MrSID file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
Model descriptor
- All models returned by this model decoder have a
TLcdMrSIDModelDescriptor
. - The type name of the model descriptor is the display name of this decoder.
Model reference
- This decoder retrieves the model references embedded in the ECW file.
- It is possible to specify a
default reference
for files from which the reference information is mssing. - A
custom reference decoder
can also be installed.
Model elements
- Each decoded model contains one object: an
ALcdImage
(andILcdMultilevelRaster
) instance.
Useful settings
- The property
defaultValue
allows the specify the default value that is assigned to decoded rasters.
Sample code
ILcdModelDecoder decoder = new TLcdMrSIDModelDecoder();
ILcdModel model = decoder.decode("raster.sid");
Performance tips
- The decoded rasters load their data lazily. The encoding parameters of the MrSID file may affect the run-time performance.
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models are thread-safe for read access.
Supported versions and specifications
- MrSID Generation 2, 3 and 4
Known limitations
- LiDAR point clouds are not supported.
- Password protected files are not supported.
- Some rare EPSG model references are not supported.
- This decoder cannot be used on Linux 32 bit systems.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates 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, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given buffer, model reference decoder, and default value.TLcdMrSIDModelDecoder
(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder, ILcdModelReference aDefaultModelReference, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given properties.TLcdMrSIDModelDecoder
(ILcdBuffer aBuffer, ILcdModelReference aDefaultModelReference, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given buffer, default model reference, and default value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Checks whetherTLcdMrSIDModelDecoder
can decode the given data.Creates a new model from the given data source.Sets the default model bounds that is assigned to rasters of the decoded models whose image files don't specify bounds.Returns the default model reference that is assigned to decoded models whose image files don't specify model references.int
Returns the default pixel value that is assigned to the rasters of the decoded models.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.double
Returns the maximum acceptable average residual error for tie points.Deprecated.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
DEFAULT_DISPLAY_NAME
- See Also:
-
EPSILON
public static final double EPSILON- See Also:
-
-
Constructor Details
-
TLcdMrSIDModelDecoder
public TLcdMrSIDModelDecoder()Creates a new TLcdMrSIDModelDecoder, with a globally shared buffer for caching pixel data.- See Also:
-
TLcdMrSIDModelDecoder
Creates a new TLcdMrSIDModelDecoder with the given buffer.- Parameters:
aBuffer
- the buffer in which pixel data can be decoded and cached.
-
TLcdMrSIDModelDecoder
Creates a new TLcdMrSIDModelDecoder with the given buffer and model reference decoder.- Parameters:
aBuffer
- the buffer in which pixel data can be decoded and cached.aModelReferenceDecoder
- the model reference decoder.
-
TLcdMrSIDModelDecoder
public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given buffer, model reference decoder, and default value.- Parameters:
aBuffer
- the buffer in which pixel data can be decoded and cached.aModelReferenceDecoder
- the model reference decoder.aDefaultValue
- the default pixel value.
-
TLcdMrSIDModelDecoder
Creates a new TLcdMrSIDModelDecoder with the given buffer and default model reference.- Parameters:
aBuffer
- the buffer in which pixel data can be decoded and cached.aDefaultModelReference
- the default model reference.
-
TLcdMrSIDModelDecoder
public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReference aDefaultModelReference, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given buffer, default model reference, and default value.- Parameters:
aBuffer
- the buffer in which pixel data can be decoded and cached.aDefaultModelReference
- the default model reference.aDefaultValue
- the default pixel value.
-
TLcdMrSIDModelDecoder
public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder, ILcdModelReference aDefaultModelReference, int aDefaultValue) Creates a new TLcdMrSIDModelDecoder with the given properties.- Parameters:
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.
-
-
Method Details
-
setModelReferenceDecoder
Sets the model reference decoder that will be used for decoded models whose image files don't specify model references.- Parameters:
aModelReferenceDecoder
- the model reference decoder.
-
getModelReferenceDecoder
Returns the model reference decoder that is used for decoded models whose image files don't specify model references. The default value supports WKT (*.prj), REF (*.ref), and EPSG (*.epsg).- Returns:
- the model reference decoder used by this decoder
- See Also:
-
setDefaultModelReference
Sets the default model reference that will be assigned to decoded models whose image files don't specify model references.- Parameters:
aDefaultModelReference
- the default model reference.
-
getDefaultModelReference
Returns the default model reference that is assigned to decoded models whose image files don't specify model references. -
setModelReference
Deprecated. -
getModelReference
Deprecated. -
setBounds
Sets the default model bounds that will be assigned to rasters of the decoded models whose image files don't specify bounds.- Parameters:
aBounds
- the default model bounds.
-
getBounds
Sets the default model bounds that is assigned to rasters of the decoded models whose image files don't specify bounds. -
setMaximumResidualTiePointError
public 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.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.
-
getMaximumResidualTiePointError
public double getMaximumResidualTiePointError()Returns the maximum acceptable average residual error for tie points. -
setDefaultValue
public void setDefaultValue(int aDefaultValue) Sets the default pixel value that will be assigned to the rasters of the decoded models.- Parameters:
aDefaultValue
- the default pixel value.- See Also:
-
getDefaultValue
public int getDefaultValue()Returns the default pixel value that is assigned to the rasters of the decoded models. -
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Checks whetherTLcdMrSIDModelDecoder
can decode the given data. The extension of the file name should be "sid" or "sdw".- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the name of the file that is to be decoded.- Returns:
true
ifTLcdMrSIDModelDecoder
can decode the data specified by the source name,false
otherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is 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:
-
.getDefaultModelReference()