Interface FeatureTypeStyle

All Known Implementing Classes:
FeatureTypeStyleImpl

public interface FeatureTypeStyle
Represents a style that applies to features or coverage.
Since:
GeoAPI 2.2
Author:
Open Geospatial Consortium, Johann Sorel (Geomatys), Chris Dillard (SYS Technologies)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Applies a color composition/blending operation at the feature type style level (that is, blending the current FTS level against the map below it).
    static final String
    Boolean value, if true the current feature type style will be treated as a base for the subsequent feature type styles in the rendering stack (including other layer ones) as opposed to use the merged backdrop rendered so far.
    static final String
    This option influences how multiple rules matching the same feature are evaluated
    static final String
    A boolean vendor option, if true then the raster transformations will receive oversampled data
    static final String
    String value controlling the order in which the features are loaded from the data source, and thus painted, in this feature type style.
    static final String
    String value controlling cross layer z-ordering.
    static final String
    The standard behavior, all the matching rules are executed
    static final String
    Only the first matching rule gets executed, all the others are skipped
    static final String
    String value allowing to control whether an SLD element should be included when applying the style to render maps or a legends.
    static final String
    Set of attributes to be included in vector tiles.
    static final String
    Coalesce the geometries of features sharing the same attribute values
    static final String
    Set of attributes to be included in the vector tiles label layer.
    static final String
    Wheter or not a dedicated label layer should be generated for vector tiles.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    accept(TraversingStyleVisitor visitor, Object extraData)
    calls the visit method of a StyleVisitor
    Returns the names of the feature type that this style is meant to act upon.
    Description for this style.
    Returns a collection of Object identifying features object.
    Returns a name for this style.
    It is common to have a style coming from a external xml file, this method provide a way to get the original source if there is one.
    Map of vendor options for the symbolizer.
    The eventual transformation to be applied before rendering the data (should be an expression taking a feature collection or a grid coverage as the evaluation context and returns a feature collection or a grid coverage as an output)
    boolean
    Determines if a vendor option with the specific key has been set on this symbolizer.
    Rules govern the appearance of any given feature to be styled by this styler.
    Returns a collection that identifies the more general "type" of geometry that this style is meant to act upon.
    void
     
    void
    It is common to have a style coming from a external xml file, this method provide a way to get the original source if there is one.
    void
    setTransformation(Expression transformation)
    Sets the eventual transformation to be applied before rendering the data (should be an expression taking a feature collection or a grid coverage as an input and returns a feature collection or a grid coverage as an output)
  • Field Details

    • KEY_EVALUATION_MODE

      static final String KEY_EVALUATION_MODE
      This option influences how multiple rules matching the same feature are evaluated
      See Also:
    • VALUE_EVALUATION_MODE_ALL

      static final String VALUE_EVALUATION_MODE_ALL
      The standard behavior, all the matching rules are executed
      See Also:
    • VALUE_EVALUATION_MODE_FIRST

      static final String VALUE_EVALUATION_MODE_FIRST
      Only the first matching rule gets executed, all the others are skipped
      See Also:
    • COMPOSITE

      static final String COMPOSITE
      Applies a color composition/blending operation at the feature type style level (that is, blending the current FTS level against the map below it).

      The syntax for this key is {code}name[,opacity]{code} where:

      • {code}name is one of the SVG composition operations, in particular, copy, destination, source-over, destination-over, source-in, destination-in, source-out, destination-out, source-atop, destination-atop, xor, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion
      • {opacity} indicates the opacity level to be used during the operation, defauls to 1
      For example:
      • {code}source-atop, 0.5{code} composes the current FTS exclusively where the previous map has already been drawn, using a 0.5 opacity level
      • {code}multiply{code} blends the current FTS with the underlying map using color multiplication

      The same vendor option can also be applied at the symbolizer level to achieve different effects (feature by feature composition as oppose to layer by layer one).

      Important note: for most compositing operation to work properly, the graphics used for the rendering should be derived from an image that has an alpha channel and transparent background (as most of the operations consider the transparency of the target surface in their math)

      See Also:
    • COMPOSITE_BASE

      static final String COMPOSITE_BASE
      Boolean value, if true the current feature type style will be treated as a base for the subsequent feature type styles in the rendering stack (including other layer ones) as opposed to use the merged backdrop rendered so far. When the top of the stack is reached, or another base is found, this FTS will be merged into the backdrop, eventually using the indicated composite operator
      See Also:
    • SORT_BY

      static final String SORT_BY
      String value controlling the order in which the features are loaded from the data source, and thus painted, in this feature type style.

      The syntax is Attribute1 {A|D},Attribute2 {A|D}..., A is ascending, D is descending. The sorting direction is optional and defaults to ascending if not specified.

      E.g., cat D,name sorts data by cat in descending order, and then by ascending name within all features having the same cat value.

      See Also:
    • SORT_BY_GROUP

      static final String SORT_BY_GROUP
      String value controlling cross layer z-ordering. Several feature type styles in the same sortByGroup will have their features globally ordered before painting, for example, in order to respect their real world relationships. FeatureTypeStyle are grouped only if they are adjacent in the overall MapContent (even across layers). In case compositing is used in the same FeatureTypeStyle, the first value in group will be used for the entire group.
      See Also:
    • VENDOR_OPTION_INCLUSION

      static final String VENDOR_OPTION_INCLUSION
      String value allowing to control whether an SLD element should be included when applying the style to render maps or a legends. The option can be used also on Rule and all the Symbolizers. Possible values are normal, legendOnly, mapOnly.
      See Also:
    • VT_ATTRIBUTES

      static final String VT_ATTRIBUTES
      Set of attributes to be included in vector tiles. Used by the GeoServer vector tiles module, declared here so that it can be referred to from style languages.
      See Also:
    • VT_LABELS

      static final String VT_LABELS
      Wheter or not a dedicated label layer should be generated for vector tiles. Useful for polygon layers, but also for point and line layers, as it will include only features whose label attributes are not null. Used by the GeoServer vector tiles module, declared here so that it can be referred to from style languages
      See Also:
    • VT_LABEL_ATTRIBUTES

      static final String VT_LABEL_ATTRIBUTES
      Set of attributes to be included in the vector tiles label layer. Used by the GeoServer vector tiles module, declared here so that it can be referred to from style languages
      See Also:
    • VT_COALESCE

      static final String VT_COALESCE
      Coalesce the geometries of features sharing the same attribute values
      See Also:
    • RT_OVERASAMPLE

      static final String RT_OVERASAMPLE
      A boolean vendor option, if true then the raster transformations will receive oversampled data
      See Also:
  • Method Details

    • getName

      String getName()
      Returns a name for this style. This can be any string that uniquely identifies this style within a given canvas. It is not meant to be human-friendly. (The "title" property is meant to be human friendly.)
      Returns:
      a name for this style.
    • setName

      void setName(String name)
    • getDescription

      Description getDescription()
      Description for this style.
      Returns:
      Human readable description for use in user interfaces
      Since:
      2.5.x
    • getFeatureInstanceIDs

      Id getFeatureInstanceIDs()
      Returns a collection of Object identifying features object.

      ISO 19117 extends FeatureTypeStyle be providing this method. This method enable the possibility to use a feature type style on a given list of features only, which is not possible in OGC SE.

      Returns:
      Collection
    • featureTypeNames

      Set<Name> featureTypeNames()
      Returns the names of the feature type that this style is meant to act upon.

      In OGC Symbology Encoding define this method to return a single String, and ISO 19117 use a Collection of String. We've choosen ISO because it is more logic that a featureTypeStyle can be applied to multiple featuretypes and not limited to a single one.

      Returns:
      the name of the feature type that this style is meant to act upon.
    • semanticTypeIdentifiers

      Set<SemanticType> semanticTypeIdentifiers()
      Returns a collection that identifies the more general "type" of geometry that this style is meant to act upon. In the current OGC SE specifications, this is an experimental element and can take only one of the following values:

      • generic:point
      • generic:line
      • generic:polygon
      • generic:text
      • generic:raster
      • generic:any

    • rules

      List<Rule> rules()
      Rules govern the appearance of any given feature to be styled by this styler.

      This is *the* list being used to manage the rules!

      Since:
      GeoTools 2.2.M3, GeoAPI 2.0
    • getOnlineResource

      OnLineResource getOnlineResource()
      It is common to have a style coming from a external xml file, this method provide a way to get the original source if there is one. OGC SLD specification can use this method to know if a style must be written completely or if writing the online resource path is enough.
      Returns:
      OnlineResource or null
    • setOnlineResource

      void setOnlineResource(OnLineResource online)
      It is common to have a style coming from a external xml file, this method provide a way to get the original source if there is one.
      Parameters:
      online - location external file defining this style, or null if not available
    • accept

      void accept(StyleVisitor visitor)
    • getTransformation

      Expression getTransformation()
      The eventual transformation to be applied before rendering the data (should be an expression taking a feature collection or a grid coverage as the evaluation context and returns a feature collection or a grid coverage as an output)
    • accept

      Object accept(TraversingStyleVisitor visitor, Object extraData)
      calls the visit method of a StyleVisitor
      Parameters:
      visitor - the style visitor
    • setTransformation

      void setTransformation(Expression transformation)
      Sets the eventual transformation to be applied before rendering the data (should be an expression taking a feature collection or a grid coverage as an input and returns a feature collection or a grid coverage as an output)
    • hasOption

      boolean hasOption(String key)
      Determines if a vendor option with the specific key has been set on this symbolizer.
    • getOptions

      Map<String,String> getOptions()
      Map of vendor options for the symbolizer.

      Client code looking for the existence of a single option should use hasOption(String)