Class TLcdGeoSPOTModelDecoder

java.lang.Object
com.luciad.format.geospot.TLcdGeoSPOTModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdGeoSPOTModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes GeoSPOT DSC (description) and REP (report) files.

Input files

File Required Entry point Description
*.DSC
x description file that refers to one or more REP data sets
*.REP x x report file containing raster metadata and referring to a BIL image file
*.BIL x
file containing the band-interleaved image data
*.HDR x
header file containing image metadata

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the inputStreamFactory and the imageInputStreamFactory of this decoder. The imageInputStreamFactory must produce a SeekableStream.

Model reference

  • All models returned by this model decoder have a TLcdUTMGrid reference. The UTM zone is retrieved from the .REP file.

Model structure

  • This model decoder creates a model per GeoSPOT data set.
  • All models returned by this model decoder implement ILcd2DBoundsIndexedModel.

Model descriptor

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

Model elements

Useful settings

  • The property forcedTransparentColorIndex provides some control over the color models that are attached to the decoded rasters.

Sample code


 ILcdModelDecoder decoder = new TLcdGeoSPOTModelDecoder();

 ILcdModel model = decoder.decode("IMAGE.REP");
 

Performance tips

  • GeoSPOT rasters can be large. 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 GeoSPOT files.

Thread safety

  • The decoding of models is not thread-safe.
  • The decoded models are thread-safe for read access.

Supported versions and specifications

  • Spatiocartes Défense, Spécification du produit numérique, Annexe B - Contenu des fichiers GeoSPOT, Edition 1.1 avec l'amendement 1

Known limitations

  • All rasters listed in a single DSC file must be defined in the same UTM reference system.
Since:
3.3
  • Field Details

  • Constructor Details

    • TLcdGeoSPOTModelDecoder

      public TLcdGeoSPOTModelDecoder()
      Creates a new TLcdGeoSPOTModelDecoder, with a globally shared buffer for caching tiles.
      See Also:
    • TLcdGeoSPOTModelDecoder

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

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • setForcedTransparentColorIndex

      public void setForcedTransparentColorIndex(int aForcedTransparentColorIndex)
      Sets the index of a color that should be made transparent in the gray scale rasters that will be decoded next. The default is 0.
    • getForcedTransparentColorIndex

      public int getForcedTransparentColorIndex()
      Returns the index of a color that is made transparent in the gray scale rasters that are decoded.
    • 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: