Interface ILcdWMSGetLegendGraphicRequestEncoder

All Known Implementing Classes:
TLcdDefaultWMSGetLegendGraphicEncoder

public interface ILcdWMSGetLegendGraphicRequestEncoder
This interface specifies methods to encode the result of a GetLegendGraphic request.
The type of encoding is defined by the actual implementations.
Each ILcdWMSLegendGraphicRequestEncoder has a content type that identifies the type of data encoded by the implementation. This is the MIME - TYPE of the encoded result. Allowed values are the same as for the FORMAT parameter of the WMS GetMap request. This list contains a number of basic image formats like png and jpeg, but also non image formats like pdf and kml. The user can select any format from this list as long as the data written to the output stream complies with the expected MIME - TYPE, most clients however offer only support for image formats.
To plug in your own implementation you need to override ALcdOGCWMSCommandDispatcherFactory.createWMSGetLegendGraphicEncoders(ServletConfig) and add your encoder to the array that is returned.
  • Method Details

    • getContentType

      String getContentType()
      Returns the content MIME type of the encoder.
      Returns:
      the MIME-type as String.
    • encode

      boolean encode(TLcdWMSGetLegendGraphicRequestContext aWMSGetLegendGraphicRequestContext, TLcdWMSRequestContext aWMSRequestContext, OutputStream aOutputStream) throws IOException
      Encodes the legend graphic for a given layer and sends it to the given OutputStream.
      Parameters:
      aWMSGetLegendGraphicRequestContext - a container for all relevant information that might be useful when generating legends
      aWMSRequestContext - a container for the original request and other related request parameters.
      aOutputStream - the OutputStream to write the output to. The type of data is given by getContentType().
      Returns:
      True if the encoder can handle this case, false if it does not.
      Throws:
      IOException - for any I/O Exceptions.
      Since:
      2022.0