Class TLcdDIMAPModelDecoder

java.lang.Object
com.luciad.format.dimap.TLcdDIMAPModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdDIMAPModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes DIMAP XML files (Digital Image Map).

Input files

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

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the inputStreamFactory of this decoder. The input stream factory must produce a SeekableStream for the image file.

Model structure

  • This model decoder creates a model per DIMAP volume file or DIMAP metadata file.
  • All models returned by this model decoder implement ILcd2DBoundsIndexedModel.

Model descriptor

  • All models returned by this model decoder have a TLcdDIMAPModelDescriptor.
  • The type name of the model descriptor is the display name of this decoder.

Model elements

  • Each decoded model contains one object: an ALcdImage (and ILcdRaster) instance.

Useful settings

  • If the raster location is specified by means of tie points, the properties minimumTiePointCount, allowOrthographicReferencing, and maximumResidualTiePointError provide some control over the model reference system that is created and the minimal accuracy that is required.

Sample code


 ILcdModelDecoder decoder = new TLcdDIMAPModelDecoder();

 ILcdModel model = decoder.decode("METADATA.DIM");
 

Performance tips

  • The actual DIMAP rasters are often stored in GeoTIFF files at a single level of detail and with a planar configuration. Precomputing and storing multiple levels of detail may speed up visualization and some computations. The TLcdGeoTIFFModelEncoder can create compressed multilevel GeoTIFF files that can replace the original DIMAP files.

Thread safety

  • The decoding of models is thread-safe, as long as no properties are changed during the decoding.
  • The decoded models and elements are thread-safe for read access, on the condition that a thread-safe buffer is used.

Supported versions and specifications

  • DIMAP 1.1 approved specifications, Spotimage, December 2004

Known limitations

  • All rasters listed in a single DIMAP volume file must be defined in the same reference system.
Since:
4.0
  • Field Details

  • Constructor Details

    • TLcdDIMAPModelDecoder

      public TLcdDIMAPModelDecoder()
      Creates a new TLcdDIMAPModelDecoder, with a globally shared buffer for caching any DTED raster tiles.
      See Also:
    • TLcdDIMAPModelDecoder

      public TLcdDIMAPModelDecoder(ILcdBuffer aBuffer)
      Creates a new TLcdDIMAPModelDecoder.
      Parameters:
      aBuffer - the buffer in which any decoded DTED raster tiles will be cached.
  • Method Details

    • setMinimumTiePointCount

      public void setMinimumTiePointCount(int aMinimumTiePointCount)
      Sets the minimum number of tie points required for positioning rasters that provide tie points instead of scaling information. The default is 4.

      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.

      Parameters:
      aMinimumTiePointCount - the minimum number of tie points.
      See Also:
    • getMinimumTiePointCount

      public int getMinimumTiePointCount()
      Returns the minimum number of tie points required for positioning image files that provide tie points.
    • setAllowOrthographicReferencing

      public 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. The default is true.
    • isAllowOrthographicReferencing

      public 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.
    • setMaximumResidualTiePointError

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

      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.
      See Also:
    • getMaximumResidualTiePointError

      public double getMaximumResidualTiePointError()
      Returns the maximum acceptable average residual error for tie points.
    • setRasterReferencer

      public void setRasterReferencer(ILcdRasterReferencer aRasterReferencer)
      Sets the raster referencer that will be used when positioning image files based on tie points. If it is set, it replaces the more basic settings minimumTiePointCount, allowOrthographicReferencing, and maximumResidualTiePointError, which are used by default.
      Parameters:
      aRasterReferencer - the raster referencer, which will create model references and raster bounds based on tie points.
    • getRasterReferencer

      public ILcdRasterReferencer getRasterReferencer()
      Returns the raster referencer that is used when positioning image files based on tie points.
    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams. It must create SeekableStream instances for the image file in order for JAI to be able to use them.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Description copied from interface: ILcdInputStreamFactoryCapable
      Returns the input stream factory that is used.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • 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)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return 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.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely 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: