Interface ILcdWCSModelEncoderFactory


public interface ILcdWCSModelEncoderFactory
A factory for model encoders to be used by WCS. The WCS framework addresses the following concerns:
  • Clip the input model to the output bounds.
  • Transform the input model's image to the output reference.
  • Convert models containing legacy ILcdRaster elements to models containing ALcdImage elements.
  • Pick the most appropriate level from an ALcdMultilevelImage or ALcdMultilevelImageMosaic based on output resolution, and fall back to less detailed levels in case of missing tiles or no-data-values.
  • Composite multiple ALcdImage elements into a single ALcdBasicImage.
Because the WCS framework addresses all of these concerns, the model encoders can be kept relatively simple:
  • The WCS framework calls ILcdModelEncoder.export(ILcdModel, String) with a model that has a single ALcdBasicImage. Model encoders created by this factory should be able to export such a model. They do not need to be able to export models that have ALcdMultilevelImage, ALcdImageMosaic or ALcdMultilevelImageMosaic, but they may.
  • The WCS framework never calls ILcdModelEncoder.canSave(ILcdModel) nor ILcdModelEncoder.save(ILcdModel). Model encoder implementations may safely throw UnsupportedOperationExceptions for those methods.
  • ILcdModelEncoder.canExport(ILcdModel, String) is an optimistic check that has the semantics of a 'maybe'. It is a quick check to see if it's worthwhile to try and export a model. Implementations should return false if they cannot export a model, but they may return true in case of doubt. The actual ILcdModelEncoder.export(ILcdModel, String) may then still throw an IllegalArgumentException to indicate that the model could not be exported after all.
  • An ALcdBasicImage may have an arbitrary number of bands of a variety of data types, see ALcdBandSemantics.DataType. Implementations may have limits to what is allowed here, and should throw IllegalArgumentException when they can't export a model.
  • The default implementation used for WCS includes support for GeoTFF, JPEG 2000, PNG and JPEG. For GeoTIFF and JPEG 2000, the used encoders are respectively TLcdGeoTIFFModelEncoder. and TLcdJPEG2000ModelEncoder. The produced TIFFs and JPEGs are tiled by default, which is generally preferred for performance reasons. To enhance the interoperability with clients that do not support tiled data, this can be changed through the parameter wcs.outputFormat.geotiff.enableTiling available in the the deployment descriptor web.xml file.
  • The WCS GetCapabilities and DescribeCoverage responses list the supported output formats aligned with the used WCS version. In case of WCS 1.x, the output formats are listed in the DescribeCoverage response. In case of WCS 2.0.1, the output formats are listed in the GetCapabilities response. When you plug in a custom ILcdWCSModelEncoderFactory, you can define the output formats to be listed for your implementation via getSupportedOutputFormats(TLcdWCSRequestContext).

If your model encoder implements ILcdWCSModelEncoder, the WCS framework will, for backwards compatibility, not perform any of the aforementioned processing such as clipping, transforming and converting. Instead, it will pass the input model directly to ILcdModelEncoder.export(ILcdModel, String). The implementation is then entirely responsible for clipping, transforming and converting.

  • Method Details

    • createModelEncoder

      ILcdModelEncoder createModelEncoder(ILcdModel aModel, ILcdOutputStreamFactory aOutputStreamFactory, String aOutputFormat, TLcdWCSRequestContext aRequestContext)
      Returns a model encoder that can write the given model to an output stream provided by the given factory, in the given format.
      Parameters:
      aModel - An ILcdModel.
      aOutputStreamFactory - An ILcdOutputStreamFactory.
      aOutputFormat - A string describing the requested output format, e.g. "GeoTIFF".
      aRequestContext - Context information regarding the WCS request being handled.
      Returns:
      An ILcdModelEncoder.
    • getSupportedOutputFormats

      default List<String> getSupportedOutputFormats(TLcdWCSRequestContext aContext)
      Returns the output formats for which this factory can produce model encoders.
      Parameters:
      aContext - context information regarding the WCS request being handled
      Returns:
      the output formats for which this factory can produce model encoders.
      Since:
      2025.0.03