@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdGeoSPOTModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
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 |
inputStreamFactory
and the
imageInputStreamFactory
of this decoder. The
imageInputStreamFactory
must produce a
SeekableStream
.TLcdUTMGrid
reference.
The UTM zone is retrieved from the .REP file.
ILcd2DBoundsIndexedModel
.TLcdGeoSPOTModelDescriptor
.TLcdGeoSPOTRaster
instances. They provide more information about the raster, thru
their TLcdGeoSPOTRasterDescriptor
objects.forcedTransparentColorIndex
provides some control over the color models that are attached to the
decoded rasters.
ILcdModelDecoder decoder = new TLcdGeoSPOTModelDecoder();
ILcdModel model = decoder.decode("IMAGE.REP");
TLcdGeoTIFFModelEncoder
can create compressed multilevel GeoTIFF
files that can replace the original GeoSPOT files.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DISPLAY_NAME |
Constructor and Description |
---|
TLcdGeoSPOTModelDecoder()
Creates a new TLcdGeoSPOTModelDecoder, with a globally shared buffer for
caching tiles.
|
TLcdGeoSPOTModelDecoder(ILcdBuffer aBuffer)
Creates a new TLcdGeoSPOTModelDecoder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
int |
getForcedTransparentColorIndex()
Returns the index of a color that is made transparent in the gray scale
rasters that are decoded.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used for creating input streams
given source names.
|
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.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams
given source names.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String DEFAULT_DISPLAY_NAME
public TLcdGeoSPOTModelDecoder()
TLcdSharedBuffer.getBufferInstance()
public TLcdGeoSPOTModelDecoder(ILcdBuffer aBuffer)
aBuffer
- the buffer in which decoded raster tiles will be cached.public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public void setForcedTransparentColorIndex(int aForcedTransparentColorIndex)
public int getForcedTransparentColorIndex()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
ILcdModelDecoder
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.
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aSourceName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.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);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)