Class TLcdSLDFeatureTypeStyleEncoder

java.lang.Object
com.luciad.ogc.sld.xml.TLcdSLDFeatureTypeStyleEncoder
All Implemented Interfaces:
ILcdOutputStreamFactoryCapable

public class TLcdSLDFeatureTypeStyleEncoder extends Object implements ILcdOutputStreamFactoryCapable
XML Encoder for TLcdSLDFeatureTypeStyle objects to documents according to version 1.1.0 of the OGC Symbology Encoding Implementation Specification or version 1.0 of the OGC Styled Layer Descriptor Implementation Specification.

Note that the files produced do not contain SLD top elements.

Since:
6.1
  • Constructor Details

    • TLcdSLDFeatureTypeStyleEncoder

      public TLcdSLDFeatureTypeStyleEncoder()
      Creates a new TLcdSLDFeatureTypeStyleEncoder with a default file output stream factory.
  • Method Details

    • setOutputStreamFactory

      public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
      Sets the output stream factory that will be used for creating output streams given source names.
      Specified by:
      setOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Parameters:
      aOutputStreamFactory - the output stream factory to be used.
    • getOutputStreamFactory

      public ILcdOutputStreamFactory getOutputStreamFactory()
      Returns the output stream factory that is currently used for creating output streams given source names.
      Specified by:
      getOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Returns:
      the input stream factory that is currently used.
    • encodeFeatureTypeStyle

      public void encodeFeatureTypeStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, String aSourceName) throws IOException
      Encodes the given feature type style to the given destination. The version of the TLcdSLDFeatureTypeStyle is used to determine the encoding format, which can be Styled Layer Descriptor 1.0.0 or Symbology Encoding 1.1.0.

      No version corresponds to an 1.0.0 SLD. Properties of the style that are not supported by the version will be omitted from the generated XML.

      Parameters:
      aFeatureTypeStyle - the given feature type style.
      aSourceName - the full path to the source where the object should be written.
      Throws:
      IOException - thrown if an error occurs during the write process.
      See Also:
      • ALcdSLDFeatureTypeStyle.getVersion()
    • encodeFeatureTypeStyle

      public final void encodeFeatureTypeStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, OutputStream aOutputStream) throws IOException
      Encodes the given feature type style to the given output stream. The version of the TLcdSLDFeatureTypeStyle is used to determine the encoding format, which can be Styled Layer Descriptor 1.0.0 or Symbology Encoding 1.1.0.

      No version corresponds to an 1.0.0 SLD. Properties of the style that are not supported by the version will be omitted from the generated XML.

      Parameters:
      aFeatureTypeStyle - the given feature type style.
      aOutputStream - The stream to write the output to
      Throws:
      IOException - thrown if an error occurs during the write process.
      Since:
      2017.0
      See Also:
      • ALcdSLDFeatureTypeStyle.getVersion()
    • encodeToString

      public static String encodeToString(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) throws IOException
      Utility method which encodes the SLD feature type style as an XML string.
      Parameters:
      aSLDFeatureTypeStyle - The SLD feature type style
      Returns:
      An XML-encoded version of aSLDFeatureTypeStyle
      Throws:
      IOException - When something goes wrong during the encoding
      Since:
      2017.0