@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdBCIRasterModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
File | Required | Entry point | Description |
---|---|---|---|
{frame,rast}*/matrxmap | x | x | file containing raster metadata |
{frame,rast}*/qdr/*.qdr | x | files containing the actual raster data | |
{frame,rast}*/vqtable | file containing a vector quantization table |
inputStreamFactory
of this decoder.ILcd2DBoundsIndexedModel
.ILcdGridReference
or an
ILcdGeodeticReference
.TLcdBCIRasterModelDescriptor
.ALcdImage
(and ILcdRaster
) instance.
ILcdModelDecoder decoder = new TLcdBCIRasterModelDecoder();
ILcdModel model = decoder.decode("frame0033/matrxmap");
TLcdGeoTIFFModelEncoder
can create compressed multilevel GeoTIFF
files that can replace the original BCI files.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DISPLAY_NAME
The default display name of this decoder.
|
Constructor and Description |
---|
TLcdBCIRasterModelDecoder()
Creates a model decoder to decode BCI raster files.
|
TLcdBCIRasterModelDecoder(ILcdBuffer aBuffer)
Creates a model decoder to decode BCI raster files.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether
TLcdBCIRasterModelDecoder can decode the given data. |
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 . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used for creating input streams
given source names.
|
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 TLcdBCIRasterModelDecoder()
TLcdSharedBuffer.getBufferInstance()
public TLcdBCIRasterModelDecoder(ILcdBuffer aBuffer)
aBuffer
- the buffer to cache decoded raster tiles in.public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- The input stream factory to be used for creating input stream.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
TLcdBCIRasterModelDecoder
can decode the given data.
The test is based on the source name, which should be matrxmap
(case insensitive). If this source name is recognized, true
is
returned. In all other cases, false
is returned.canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the name of the file or URL that is to be decoded.true
if the source name is matrxmap
(case insensitive),
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)