Interface FeatureTypeStyle
-
- All Superinterfaces:
FeatureTypeStyle
- All Known Implementing Classes:
FeatureTypeStyleImpl
public interface FeatureTypeStyle extends FeatureTypeStyle
How to style a feature type. This is introduced as a convenient package that can be used independently for feature types, for example in GML Default Styling. The "layer" concept is discarded inside of this element and all processing is relative to feature types. The FeatureTypeName is allowed to be optional, but only one feature type may be in context and it must match the syntax and semantics of all attribute references inside of the FeatureTypeStyle.The details of this object are taken from the OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.:
<xsd:element name="FeatureTypeStyle"> <xsd:annotation> <xsd:documentation> A FeatureTypeStyle contains styling information specific to one feature type. This is the SLD level that separates the 'layer' handling from the 'feature' handling. </xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:sequence> <xsd:element ref="sld:Name" minOccurs="0"/> <xsd:element ref="sld:Title" minOccurs="0"/> <xsd:element ref="sld:Abstract" minOccurs="0"/> <xsd:element ref="sld:FeatureTypeName" minOccurs="0"/> <xsd:element ref="sld:SemanticTypeIdentifier" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="sld:Rule" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
- Author:
- James Macgill, CCG
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
FeatureTypeStyle.RenderingSelectionOptions
-
Field Summary
Fields Modifier and Type Field Description static 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).static 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.static String
KEY_EVALUATION_MODE
This option influences how multiple rules matching the same feature are evaluatedstatic 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.static String
SORT_BY_GROUP
String value controlling cross layer z-ordering.static String
VALUE_EVALUATION_MODE_ALL
The standard behavior, all the matching rules are executedstatic String
VALUE_EVALUATION_MODE_FIRST
Only the first matching rule gets executed, all the others are skippedstatic 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.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accept(StyleVisitor visitor)
Description
getDescription()
Description for this style.Map<String,String>
getOptions()
Map of vendor options for the symbolizer.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)boolean
hasOption(String key)
Determines if a vendor option with the specific key has been set on this symbolizer.List<Rule>
rules()
Rules govern the appearance of any given feature to be styled by this styler.void
setName(String name)
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.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)-
Methods inherited from interface FeatureTypeStyle
accept, featureTypeNames, getFeatureInstanceIDs, getName, getOnlineResource, semanticTypeIdentifiers
-
-
-
-
Field Detail
-
KEY_EVALUATION_MODE
static final String KEY_EVALUATION_MODE
This option influences how multiple rules matching the same feature are evaluated- See Also:
- Constant Field Values
-
VALUE_EVALUATION_MODE_ALL
static final String VALUE_EVALUATION_MODE_ALL
The standard behavior, all the matching rules are executed- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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
- {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:
- Constant Field Values
-
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:
- Constant Field Values
-
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 bycat
in descending order, and then by ascendingname
within all features having the samecat
value.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Method Detail
-
setName
void setName(String name)
-
getDescription
Description getDescription()
Description for this style.- Specified by:
getDescription
in interfaceFeatureTypeStyle
- Returns:
- Human readable description for use in user interfaces
- Since:
- 2.5.x
-
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!
- Specified by:
rules
in interfaceFeatureTypeStyle
- Returns:
- the list of rules. can not be null but can be empty.
- Since:
- GeoTools 2.2.M3, GeoAPI 2.0
-
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)- Specified by:
getTransformation
in interfaceFeatureTypeStyle
- Returns:
- Transformation or null
-
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)
-
-