Package com.luciad.format.geospot
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
inputStreamFactoryand theimageInputStreamFactoryof this decoder. TheimageInputStreamFactorymust produce aSeekableStream.
Model reference
-
All models returned by this model decoder have a
TLcdUTMGridreference. 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
- Each decoded model contains one or more
TLcdGeoSPOTRasterinstances. They provide more information about the raster, thru theirTLcdGeoSPOTRasterDescriptorobjects.
Useful settings
- The property
forcedTransparentColorIndexprovides 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
TLcdGeoTIFFModelEncodercan 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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TLcdGeoSPOTModelDecoder, with a globally shared buffer for caching tiles.TLcdGeoSPOTModelDecoder(ILcdBuffer aBuffer) Creates a new TLcdGeoSPOTModelDecoder. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.intReturns the index of a color that is made transparent in the gray scale rasters that are decoded.Returns the input stream factory that is used for creating input streams given source names.voidsetForcedTransparentColorIndex(int aForcedTransparentColorIndex) Sets the index of a color that should be made transparent in the gray scale rasters that will be decoded next.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
DEFAULT_DISPLAY_NAME
- See Also:
-
-
Constructor Details
-
TLcdGeoSPOTModelDecoder
public TLcdGeoSPOTModelDecoder()Creates a new TLcdGeoSPOTModelDecoder, with a globally shared buffer for caching tiles.- See Also:
-
TLcdGeoSPOTModelDecoder
Creates a new TLcdGeoSPOTModelDecoder.- Parameters:
aBuffer- the buffer in which decoded raster tiles will be cached.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is used for creating input streams given source names.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- 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
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows 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:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis 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:
-