Package com.luciad.ogc.wcs.client
Class ALcdWCSCoverageDecoder
java.lang.Object
com.luciad.ogc.wcs.client.ALcdWCSCoverageDecoder
- Direct Known Subclasses:
TLcdGeoTIFFWCSCoverageDecoder
A decoder for WCS GetCoverage responses which decodes a response as an ILcdModel which contains a single
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");
- Since:
- 2015.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanDecodeCoverage(String aOutputFormat) Checks whether or not this decoder can decode a GetCoverage response in the given output format.abstract ILcdModeldecodeCoverage(String aOutputFormat, String aContentType, InputStream aContent, TLcdWCSGetCoverageRequest aRequest) Decodes a GetCoverage response as anILcdModel.
-
Constructor Details
-
ALcdWCSCoverageDecoder
public ALcdWCSCoverageDecoder()
-
-
Method Details
-
canDecodeCoverage
Checks whether or not this decoder can decode a GetCoverage response in the given output format. The check must be quick and may be optimistic: implementations must returntruewhen they probably can decode a response in the given output format. When they returnfalse, they most definitely can't decode the given output format. 'true' has the semantics of 'probably', while 'false' really means 'no'. When this method returnstrue, a subsequent invocation ofdecodeCoverage(java.lang.String, java.lang.String, java.io.InputStream, com.luciad.ogc.wcs.client.TLcdWCSGetCoverageRequest)may yet throw anIOExceptionto indicate that this decoder couldn't decode the coverage response after all.- Parameters:
aOutputFormat- the requested output format, nevernull.- Returns:
trueif this decoder can probably decode a GetCoverage response in the given output format,falsewhen it most definitely can't.
-
decodeCoverage
public abstract ILcdModel decodeCoverage(String aOutputFormat, String aContentType, InputStream aContent, TLcdWCSGetCoverageRequest aRequest) throws IOException Decodes a GetCoverage response as anILcdModel. The model must support the imaging API, which means that it should either contain an element which is or has anALcdImage.An element is an
ALcdImageif it is anALcdBasicImage,ALcdMultilevelImage,ALcdImageMosaicorALcdMultilevelImageMosaic.An element has an
ALcdImageif it is anILcdDataObjectwith anALcdImageas geometry property, as defined by a data type with aTLcdHasGeometryAnnotationin 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- Parameters:
aOutputFormat- the requested output format, nevernullaContentType- the content type (MIME type) of the GetCoverage response, possiblynullaContent- the GetCoverage response content as a stream, nevernullaRequest- the request, nevernull- Returns:
- the decoded coverage response as a model which contains an
ALcdBasicImage,ALcdMultilevelImage,ALcdImageMosaicorALcdMultilevelImageMosaic - Throws:
IOException- if this decoder couldn't decode the content
-