mapscript.labelObj¶
- class mapscript.labelObj¶
- The LABEL object - Overview - The labelObj has the following relationships:       - Attributes - align- int See ALIGN - angle- double See ANGLE - anglemode- enum MS_POSITIONS_ENUM One of - AUTO- AUTO2, or- FOLLOW- see ANGLE- autominfeaturesize- buffer- int Space to reserve around a label (padding) - see BUFFER - color- encoding- char Supported encoding format to be used for labels - see ENCODING - font- char Name of TrueType font see FONT - force- int Indicates if labels must be drawn - see FORCE - maxlength- int See MAXLENGTH - maxoverlapangle- double See MAXOVERLAPANGLE - maxscaledenom- double See MAXSCALEDENOM - maxsize- int Maximum height in pixels for scaled labels. - mindistance- int Minimum distance in pixels between duplicate labels - see MINDISTANCE - minfeaturesize- int Minimum feature size (in pixels) to label, features of this size or greater will be labeled - see MINFEATURESIZE - minscaledenom- double See MINSCALEDENOM - minsize- int Minimum height in pixels - see MINSIZE - numstyles- int The number of styles associated with the label - offsetx- int Horizontal offset of label - see OFFSET - offsety- int Vertical offset of label - see OFFSET - outlinecolor- colorObjColor of one point outline - see OUTLINECOLOR- outlinewidth- int See OUTLINEWIDTH - partials- int Indicates if labels can run off the edge of an image, either - MS_TRUEor- MS_FALSE(default) - see PARTIALS- position- int See POSITION - priority- int Priority level 1 to - MS_MAX_LABEL_PRIORITY, default=1 - see PRIORITY- refcount- int immutable TODO Add documentation - repeatdistance- int See REPEATDISTANCE - shadowcolor- colorObjSee SHADOWCOLOR- shadowsizex- int See SHADOWSIZE - shadowsizey- int See SHADOWSIZE - size- int Annotation height in pixels - see SIZE - sizeunits- int Supersedes class's sizeunits, defaults to - MS_INHERIT.- space_size_10- double Cached size of a single space character used for label text alignment of rfc40 - thisown- The membership flag - wrap- char See WRAP - Methods - __init__()[ソース]¶
- Create a new - labelObj. A- labelObjis associated with a- classObja- scalebarObjor a- legendObj. An instance of- labelObjcan exist outside of a- classObjcontainer and be explicitly inserted into the- classObj:- >>> new_label = new labelObj() - >>> the_class.addLabel(new_label) 
 - convertToString() char[ソース]¶
- Output the - labelObjobject as a Mapfile string. Provides the inverse option for- labelObj.updateFromString().
 - getBinding(binding: int) char const[ソース]¶
- Get the attribute binding for a specified label property. Returns NULL if there is no binding for this property. 
 - insertStyle(style: styleObj, index: int = -1) int[ソース]¶
- 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. 
 - removeExpressionBinding(binding: int) int[ソース]¶
- Remove an expression binding for a specified label property. 
 - removeStyle(index: int) styleObj[ソース]¶
- Remove the styleObj at index from the styles array and return a copy. 
 - setBinding(binding: int, item: char const) int[ソース]¶
- Set the attribute binding for a specified label property. Binding constants look like this: - MS_LABEL_BINDING_[attribute name]:- >>> new_label.setBinding(MS_LABEL_BINDING_COLOR, "FIELD_NAME_COLOR") 
 - setExpressionBinding(binding: int, text: char const) int[ソース]¶
- Set the expression binding for a specified label property. Binding constants look like this: - MS_LABEL_BINDING_[attribute name]Expressions are automatically wrapped in brackets, so do not need to be added to the input string- >>> new_label.setExpressionBinding(MS_LABEL_BINDING_PRIORITY, "[priority] * 2") 
 - updateFromString(snippet: char) int[ソース]¶
- Update a - labelObjfrom a string snippet. Returns- MS_SUCCESSor- MS_FAILURE
 









 
        
          
            



