Package sld :: Class Rule
[hide private]
[frames] | no frames]

Class Rule

source code


A rule object contains a title, an optional Filter, and one or more Symbolizers. A Rule is a child of a FeatureTypeStyle.


Properties:
Instance Methods [hide private]
 
__init__(self, parent, index, descendant=True)
Create a new Rule node.
source code
 
normalize(self)
Normalize this node prior to validation.
source code
Filter
create_filter(self, propname=None, comparitor=None, value=None)
Create a Filter for this rule.
source code
Symbolizer
create_symbolizer(self, stype)
Create a Symbolizer of the specified type on this rule.
source code

Inherited from SLDNode: create_element, get_or_create_element

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from SLDNode: makeproperty

Class Variables [hide private]

Inherited from SLDNode (private): _nsmap

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, index, descendant=True)
(Constructor)

source code 

Create a new Rule node.

Parameters:
  • parent (FeatureTypeStyle) - The parent class object.
  • descendant (boolean) - A flag indicating if this is a descendant node of the parent.
Overrides: object.__init__

normalize(self)

source code 

Normalize this node prior to validation. This is required, as the ogc:Filter node must come before any symbolizer nodes. The SLD is modified in place.

create_filter(self, propname=None, comparitor=None, value=None)

source code 

Create a Filter for this rule. The property name, comparitor, and value are required to create a valid Filter.

Parameters:
  • propname (string) - The name of the property to filter.
  • comparitor (string) - The comparison to perform on the property. One of "!=", "<", "<=", "=", ">=", ">", and "%" is required.
  • value (string) - The value of the property to compare against.
Returns: Filter
A new filter attached to this Rule.

create_symbolizer(self, stype)

source code 

Create a Symbolizer of the specified type on this rule.

Parameters:
  • stype (string) - The type of symbolizer. Allowed types are "Point", "Line", "Polygon", or "Text".
Returns: Symbolizer
A newly created symbolizer, attached to this Rule.