Interface ILcdWFSModelDecoder

All Known Implementing Classes:
TLcdWFSModelDecoderDecorator

public interface ILcdWFSModelDecoder
Creates ILcdModels from WFS data sources.

In general, it is recommended to create a model by using TLcdWFSProxyModel's builder and specifying the WFS server URL and desired feature type name. This approach commonly works in case the WFS can output the data according to a GML 2, 3.1.1 or 3.2 application schema. In case of a different exchange format or if a customized decoding process is needed, an implementation of this interface can be created and used to decode the data obtained from a WFS.

Implementations of this class can be supplied to the builder in TLcdWFSProxyModel, the recommended convenience class to create a model for a WFS data source. Alternatively, implementations can be used in combination with TLcdWFSClient, which provides low-level API methods to execute GetFeature requests and get the result as an input stream.

Implementations of this class should solely focus on decoding feature data content. Decoding and interpretation of service exception reports in case of errors are automatically handled by TLcdWFSModelDecoderDecorator, which acts as a decorator for an ILcdWFSModelDecoder. For convenience, TLcdWFSProxyModel automatically decorates any supplied ILcdWFSModelDecoder with a TLcdWFSModelDecoderDecorator.

Since:
6.2
See Also:
  • Method Details

    • canDecodeModel

      boolean canDecodeModel(String aOutputFormat)
      Given the name of an output format advertised by a WFS, determines whether or not that format can be read by this decoder.
      Parameters:
      aOutputFormat - the name of a format, e.g. "GML2"
      Returns:
      true if the specified format can be read
    • decodeModel

      ILcdModel decodeModel(String aOutputFormat, String aContentType, InputStream aInputStream, String aSourceName, Properties aRequestProperties) throws IOException
      Decodes a model from the given input stream.
      Parameters:
      aOutputFormat - the format of the data contained in the given input stream, as advertised in the WFS capabilities (e.g. "GML32)
      aContentType - the MIME content type of the data contained in the given input stream (e.g. "text/xml")
      aInputStream - the input stream containing the response of a WFS GetFeature request
      aSourceName - the WFS server's URL, which could be used to build relative paths if needed. Can be null if unknown.
      aRequestProperties - an optional set of request properties that could be used for additional web service connections (e.g. XML Schema links contained in the WFS feature data). Can be null if not required / applicable.
      Returns:
      a model
      Throws:
      IOException - if the model could not be decoded
    • decodeModel

      default ILcdModel decodeModel(String aOutputFormat, String aWFSVersion, String aContentType, InputStream aInputStream, String aSourceName, Properties aRequestProperties) throws IOException
      Decodes a model from the given input stream.

      This default method delegates to decodeModel, but you can override this to obtain the WFS version information.

      Parameters:
      aOutputFormat - the format of the data contained in the given input stream, as advertised in the WFS capabilities (e.g. "GML32)
      aWFSVersion - the WFS version of the response, null if unknown
      aContentType - the MIME content type of the data contained in the given input stream (e.g. "text/xml")
      aInputStream - the input stream containing the response of a WFS GetFeature request
      aSourceName - the WFS server's URL, which could be used to build relative paths if needed. Can be null.
      aRequestProperties - an optional set of request properties that could be used for additional web service connections (e.g. XML Schema links contained in the WFS feature data). Can be null.
      Returns:
      a model
      Throws:
      IOException - if the model could not be decoded
      Since:
      2017.0