mapscript.classObj¶
- class mapscript.classObj(layer: layerObj = None)¶
- The CLASS object. Used for symbolization and classification information. - Overview - The classObj has the following relationships:         - Examples - Class creation: - lyr = mapscript.layerObj() lyr.name = "foo" c = mapscript.classObj(lyr) assert c.thisown == 1 assert c.layer.name == lyr.name assert c.numstyles == 0 - Attributes - debug- group- char See GROUP - isfallback- int - MS_TRUEor- MS_FALSEuse- MS_TRUEif this class should be applied if and only if no other class is applicable- keyimage- char See KEYIMAGE - layer- layerObjimmutable reference to the parent layer- leader- labelLeaderObjimmutable see LEADER- maxscaledenom- double See MAXSCALEDENOM - metadata- hashTableObjimmutable see METADATA- minfeaturesize- int See MINFEATURESIZE minimum feature size in pixels - minscaledenom- double See MINSCALEDENOM - name- char See NAME should be unique within a layer - numlabels- int immutable number of labels for class - numstyles- int immutable number of styles for class - refcount- int immutable number of references to this object - sizeunits- int Supersedes layer's sizeunits and applies to all styles and labels - see LAYER SIZEUNITS - status- int - MS_ONor- MS_OFF- draw features of this class or do not - see STATUS- template- char See TEMPLATE - thisown- The membership flag - title- char See TITLE - validation- hashTableObjimmutable see VALIDATION- Methods - __init__(layer: layerObj = None)[kaynak]¶
- Create a new child classObj instance at the tail (highest index) of the class array of the parent_layer. A class can be created outside the context of a parent layer by omitting the layerObj constructor argument 
 - addLabel(label: labelObj) int[kaynak]¶
- Add a - labelObjto the- classObjand return its index in the labels array
 - clone() classObj[kaynak]¶
- Return an independent copy of the class without a parent layer - Not - In the Java & PHP modules this method is named - cloneClass.
 - createLegendIcon(map: mapObj, layer: layerObj, width: int, height: int) imageObj[kaynak]¶
- Draw and return a new legend icon 
 - drawLegendIcon(map: mapObj, layer: layerObj, width: int, height: int, dstImage: imageObj, dstX: int, dstY: int) int[kaynak]¶
- Draw the legend icon onto image at dstx, dsty. Returns - MS_SUCCESSor- MS_FAILURE
 - getExpressionString() char[kaynak]¶
- Return a string representation of the EXPRESSION enclosed in the quote characters appropriate to the expression type 
 - insertStyle(style: styleObj, index: int = -1) int[kaynak]¶
- Insert a copy of style into the styles array at index index Default is -1, or the end of the array. Returns the index at which the style was inserted. 
 - removeLabel(index: int) labelObj[kaynak]¶
- Remove the - labelObjat index from the labels array and return a reference to the- labelObj. numlabels is decremented, and the array is updated
 - removeStyle(index: int) styleObj[kaynak]¶
- Remove the - styleObjat index from the styles array and return a copy.
 - setExpression(expression: char) int[kaynak]¶
- Set EXPRESSION string where expression is a MapServer regular, logical or string expression. Returns - MS_SUCCESSor- MS_FAILURE
 - setText(text: char) int[kaynak]¶
- Set TEXT string where text is a MapServer text expression. Returns - MS_SUCCESSor- MS_FAILURE
 - updateFromString(snippet: char) int[kaynak]¶
- Update a class from a string snippet. Returns - MS_SUCCESSor- MS_FAILURE
 














