mapscript.styleObj

class mapscript.styleObj(parent_class: classObj | None = None)

The STYLE object. An instance of styleObj is associated with one instance of classObj.

Overview

The styleObj has the following relationships:

../../../_images/styleObj_classObj.png

Attributes

angle

double Angle, given in degrees, to draw the line work, default is 0, for symbols of Type HATCH, this is the angle of the hatched lines - see ANGLE

antialiased

int See ANTIALIAS

autoangle

int If the angle is set to AUTO - see ANGLE

color

colorObj Foreground or fill pen color - see COLOR

gap

double See GAP - moved from symbolObj in version 6.0

initialgap

double See INITIALGAP

linecap

int See LINECAP

linejoin

int See LINEJOIN - moved from symbolObj in version 6.0

linejoinmaxsize

double See LINEJOINMAXSIZE - moved from symbolObj in version 6.0

maxcolor

colorObj Maximum color in the COLORRANGE

maxscaledenom

double See MAXSCALEDENOM

maxsize

double Maximum pen or symbol width for scaling - see MAXSIZE

maxvalue

double related to color ranges

maxwidth

double Maximum width of the symbol - see MAXWIDTH

mincolor

colorObj Minimum color in the COLORRANGE

minscaledenom

double See MINSCALEDENOM

minsize

double Minimum pen or symbol width for scaling styles - see MINSIZE

minvalue

double related to color ranges

minwidth

double Minimum width of the symbol - see MINWIDTH

offsetx

double Draw with pen or symbol offset from map data, for shadows, hollow symbols, etc - see OFFSET

offsety

double Draw with pen or symbol offset from map data, for shadows, hollow symbols, etc - see OFFSET

opacity

int See OPACITY

outlinecolor

colorObj Outline pen color - see OUTLINECOLOR

outlinewidth

double See OUTLINEWIDTH

pattern

pattern : list Python Only

patternlength

int immutable Number of elements in the pattern attribute

polaroffsetangle

double Specified the angle - see POLAROFFSET

polaroffsetpixel

double Specifies the radius/distance - see POLAROFFSET

rangeitem

char Attribute/field that stores the values for the Color Range Mapping - see RANGEITEM

rangeitemindex

int The index of the range item - see RANGEITEM

refcount

int immutable number of references to this object

size

double Pixel width of the style's pen or symbol - see SIZE

sizeunits

int Supersedes class's SIZEUNITS to allow fine-grained sizing for improved SLD (RFC 124)

symbol

int The index within the map symbolset of the style's symbol - see SYMBOL

symbolname

char immutable Name of the style's symbol - see symbolname

thisown

The membership flag

width

double Width refers to the thickness of line work drawn, in pixels - default is 1, for symbols of type HATCH, the with is how thick the hatched lines are - see WIDTH

Methods

__init__(parent_class: classObj | None = None)[broncode]

Returns new default styleObj instance. The parent_class is optional.

clone() styleObj[broncode]

Return an independent copy of the style with no parent class.

Notitie

In the Java & PHP modules this method is named cloneStyle.

convertToString() char[broncode]

Saves the object to a string. Provides the inverse option for styleObj.updateFromString()

getBinding(binding: int) char const[broncode]

Get the attribute binding for a specified style property. Returns NULL if there is no binding for this property.

getGeomTransform() char[broncode]

Get the GEOMTRANSFORM for the style.

pattern_get() void[broncode]

Python Only** Get the pattern for the style.

pattern_set(nListSize: int) void[broncode]

Python Only** Set the pattern for the style.

removeBinding(binding: int) int[broncode]

Remove the attribute binding for a specified style property.

setBinding(binding: int, item: char const) int[broncode]

Remove the attribute binding for a specified style property.

setGeomTransform(transform: char) void[broncode]

Set the GEOMTRANSFORM for the style.

setSymbolByName(map: mapObj, symbolname: char) int[broncode]

Setting the symbol of the styleObj given the reference of the map object and the symbol name.

updateFromString(snippet: char) int[broncode]

Update a style from a string snippet. Returns MS_SUCCESS or MS_FAILURE