Class TLcdMrSIDModelDecoder

java.lang.Object
com.luciad.format.mrsid.TLcdMrSIDModelDecoder
All Implemented Interfaces:
ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdMrSIDModelDecoder extends Object implements ILcdModelDecoder
This model decoder decodes georeferenced Extensis MrSID (MultiResolution Seamless Image Database) files.

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

If this fails, the decoder's default model reference is returned. Unless set by the user, the default model reference is null.

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 an InputStream, 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 (and ILcdMultilevelRaster) 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 Details

  • Constructor Details

    • TLcdMrSIDModelDecoder

      public TLcdMrSIDModelDecoder()
      Creates a new TLcdMrSIDModelDecoder, with a globally shared buffer for caching pixel data.
      See Also:
    • TLcdMrSIDModelDecoder

      public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer)
      Creates a new TLcdMrSIDModelDecoder with the given buffer.
      Parameters:
      aBuffer - the buffer in which pixel data can be decoded and cached.
    • TLcdMrSIDModelDecoder

      public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReferenceDecoder aModelReferenceDecoder)
      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

      public TLcdMrSIDModelDecoder(ILcdBuffer aBuffer, ILcdModelReference aDefaultModelReference)
      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

      public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
      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

      public ILcdModelReferenceDecoder 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

      public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
      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

      public ILcdModelReference getDefaultModelReference()
      Returns the default model reference that is assigned to decoded models whose image files don't specify model references.
    • setModelReference

      @Deprecated public void setModelReference(ILcdModelReference aDefaultModelReference)
    • getModelReference

      @Deprecated public ILcdModelReference getModelReference()
      Deprecated.
    • setBounds

      public 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.
      Parameters:
      aBounds - the default model bounds.
    • getBounds

      public ILcdBounds 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

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Checks whether TLcdMrSIDModelDecoder can decode the given data. The extension of the file name should be "sid" or "sdw".
      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the name of the file that is to be decoded.
      Returns:
      true if TLcdMrSIDModelDecoder can decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      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: