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

Class StyledLayerDescriptor

source code


An object representation of an SLD document.


Property: NamedLayer

The named layer that this styling applies to.

Type: NamedLayer

Instance Methods [hide private]
 
__init__(self, sld_file=None)
Create a new SLD document.
source code
 
__del__(self)
Destroy the StyledLayerDescriptor object, and clear its cache.
source code
 
__deepcopy__(self, memo)
Perform a deep copy.
source code
 
normalize(self)
Normalize this node and all child nodes prior to validation.
source code
boolean
validate(self)
Validate the current file against the SLD schema.
source code
 
version(self)
Get the SLD version.
source code
 
xmlns(self)
Get the XML Namespace.
source code
NamedLayer
create_namedlayer(self, name)
Create a NamedLayer in this SLD.
source code
string
as_sld(self, pretty_print=False)
Serialize this SLD model into a string.
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]
  _cached_schema = None
A cached schema document, to prevent repeated web requests for the schema document.

Inherited from SLDNode (private): _nsmap

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sld_file=None)
(Constructor)

source code 

Create a new SLD document. If an sld file is provided, this constructor will fetch the SLD schema from the internet and validate the file against that schema.

Parameters:
  • sld_file (string) - The name of a pre-existing SLD file.
Overrides: object.__init__

__deepcopy__(self, memo)

source code 

Perform a deep copy. Instead of copying references to the schema object, create a new SLD, and deepcopy the SLD node.

normalize(self)

source code 

Normalize this node and all child nodes prior to validation. The SLD is modified in place.

validate(self)

source code 

Validate the current file against the SLD schema. This first normalizes the SLD document, then validates it. Any schema validation error messages are logged at the INFO level.

Returns: boolean
A flag indicating if the SLD is valid.

version(self)

source code 

Get the SLD version.

Decorators:
  • @property

xmlns(self)

source code 

Get the XML Namespace.

Decorators:
  • @property

create_namedlayer(self, name)

source code 

Create a NamedLayer in this SLD.

Parameters:
  • name (string) - The name of the layer.
Returns: NamedLayer
The named layer, attached to this SLD.

as_sld(self, pretty_print=False)

source code 

Serialize this SLD model into a string.

Returns: string
The content of the SLD.