public abstract class ALcdWCSCoverageDecoder extends Object
ALcdBasicImage
, ALcdMultilevelImage
, ALcdImageMosaic
or ALcdMultilevelImageMosaic
.
A typical implementation should rely on ILcdModelDecoder
.
Example for GeoTIFF:
// Create an input stream factory for the decoder
ILcdInputStreamFactory inputStreamFactory = new ILcdInputStreamFactory() {
public InputStream createInputStream(String aSource) throws IOException {
return new FilterInputStream(aContent) {
public void close() {
// Do nothing. It's not our responsibility to close the input stream.
}
};
}
};
TLcdGeoTIFFModelDecoder decoder = new TLcdGeoTIFFModelDecoder();
decoder.setInputStreamFactory(inputStreamFactory);
return decoder.decode("Anonymous");
Constructor and Description |
---|
ALcdWCSCoverageDecoder() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canDecodeCoverage(String aOutputFormat)
Checks whether or not this decoder can decode a GetCoverage response in the given output format.
|
abstract ILcdModel |
decodeCoverage(String aOutputFormat,
String aContentType,
InputStream aContent,
TLcdWCSGetCoverageRequest aRequest)
Decodes a GetCoverage response as an
ILcdModel . |
public abstract boolean canDecodeCoverage(String aOutputFormat)
true
when they probably can
decode a response in the given output format.
When they return false
, they most definitely can't decode the given output format.
'true' has the semantics of 'probably', while 'false' really means 'no'.
When this method returns true
, a subsequent invocation of decodeCoverage(java.lang.String, java.lang.String, java.io.InputStream, com.luciad.ogc.wcs.client.TLcdWCSGetCoverageRequest)
may yet throw an
IOException
to indicate that this decoder couldn't decode the coverage response after all.aOutputFormat
- the requested output format, never null
.true
if this decoder can probably decode a GetCoverage response in the given output format,
false
when it most definitely can't.public abstract ILcdModel decodeCoverage(String aOutputFormat, String aContentType, InputStream aContent, TLcdWCSGetCoverageRequest aRequest) throws IOException
ILcdModel
.
The model must support the imaging API, which means that it should either contain an element which is or has an
ALcdImage
.
An element is an ALcdImage
if it is an ALcdBasicImage
, ALcdMultilevelImage
,
ALcdImageMosaic
or ALcdMultilevelImageMosaic
.
An element has an ALcdImage
if it is an ILcdDataObject
with an
ALcdImage
as geometry property, as defined by a data type with a
TLcdHasGeometryAnnotation
in its data model.
If the model has multiple elements, only the first one will be considered.
If the element is or has a ALcdMultilevelImageMosaic
, only the first level will be cosid
aOutputFormat
- the requested output format, never null
aContentType
- the content type (MIME type) of the GetCoverage response, possibly null
aContent
- the GetCoverage response content as a stream, never null
aRequest
- the request, never null
ALcdBasicImage
, ALcdMultilevelImage
,
ALcdImageMosaic
or ALcdMultilevelImageMosaic
IOException
- if this decoder couldn't decode the content