Previous topic


Next topic


This Page



Symbolizer for linear geometries that consists of a color and a width.

>>> Stroke('#00ff00', 4)

The color argument may also be specified as a well known name or as an rgb tuple.

>>> stroke = Stroke('green', 4)
>>> stroke = Stroke((0,255,0), 4)

The dash argument specifies a dashed stroke pattern as a list of values. Oddly positioned elements specify the length in pixels of the dash. Evenly positioned elements specify the spaces.

>>> stroke = Stroke('green', 4, [2,1,3,2])

The dash argument may also be specified as a tuple in which the first element is specifies the dash pattern described above, and the second element is an offset into the array which specifies where to begin the pattern from.

>>> stroke = Stroke('green', 4, ([2,1,3,2], 2))

The cap argument specifies how lines should be capped. Supported values include “butt”, “round”, and “square”. The ``join``argument specifies how two lines should be joined. Supported values include “miter”, “round”, and “bevel”.

The opacity argument is a float between 0 and 1 specifying the opaqueness of the stroke.

hatch(name, stroke=None, size=None)

Composes the stroke with a hatched pattern.

The name argument is the well known name of the hatch pattern. See Hatch for the list of supported names.

The stroke and size argument specify the Stroke and size to use for the hatch pattern respectively.

>>> stroke = Stroke().hatch('vertline')
icon(url, format=None, size=None)

Composes this stroke as an Icon.

The url argument is the url/file containing the image. The format argument is the format or mime type of the image.