MapWinGIS:Shapefile Labels

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

Table of contents

Contents


Methods and Properties

ApplyCategories

Determines the index of label category for every label. Must be used only when LabelCategory.ExressionType = etSingleField is set. In case of other value will return an error through LastErrorCode property. The index of category is determined by comparing the MinValue, MaxValue properties of each LabelCategory and the value of Classification field for the parent shape of the given label.

Syntax

return


ClassificationField

will be moved to Labels class The index of field whose value is used to determine category for the label. Is used in case LabelCategory.ExressionType = etSingleField

Syntax

return


GenerateCategories

Generates label categories according to the values of the chosen field in attribute table. Classification determines the method of generation. Pay attention that when number of categories increases the redraw speed will be slower.

Syntax

Parameters

Returns

True on success and false otherwise.

Enumeration tkClassificationType

return


GenerateLabels

Removes all the existing labels of the shapefile and generates labels for each shape in the shapefile. The position of labels is determined by Method parameter. The following values of this parameter can be used for polygon shapefiles: lpCenter, lpCentroid, lpInteriorPoint. For polyline shapefile lpFirstSegment, lpLastSegment, lpLongestSegement, lpMiddleSegment constants can be used. If largest part only option is set to true, the label for the largest part of shape will be visible only. For other labels Label.Visible property will be set to false. For polygon shapefiles will be determined by the area. The ???holes??? (counter-clockwise parts) won???t be labeled. For polyline shapefiles the largest part is determined by the length.

Syntax

Parameters

Returns

The number of generated labels

Enumeration tkLabelPositioning

return


Labels

Returns reference to the Labels class connected to the current layer. It???s impossible to set empty value (NULL) to this property. Correspondingly this property must never return NULL value, as LabelClass created for each shapefile automatically.

Syntax

return

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Shapefile_Labels"

This page has been accessed 603 times. This page was last modified on 11 February 2010, at 14:52.


C# : public virtual void ApplyCategories()
VB6: Sub ApplyCategories()
C# : public virtual int ClassificationField { set; get; }
VB6: Property ClassificationField As Long
C# : public virtual bool GenerateCategories(int FieldIndex, MapWinGIS.tkClassificationType Classification, int numClasses)
VB6: Function GenerateCategories(FieldIndex as Long, Classification as tkClassificationType, numClasses as Long) as Boolean
FieldIndex The index of field from attribute table based on which values the categories are generated.
Classification The method of category generation.
numClasses The number of categories to be generated in case Classification = ctClassesByValue.
ctUniqueValues = 0 For every unique value of the field separate category will be generated. MinValue and MaxValue of the category will be equal.
ctClassesByValue = 1 The interval between the minimum and maximum value of the field is divided on the specified number of the intervals. For each interval a category is created. MinValue property of the category is set to lower bound of the interval, MaxValue - to the upper.
C# : public virtual int GenerateLabels(int FieldIndex, MapWinGIS.tkLabelPositioning Method, bool SelectedOnly, bool LargestPartOnly)
VB6: Function GenerateLabels(FieldIndex as Long, Method as tkLabelPositioning, [SelectedOnly as Boolean = False], [LargestPartOnly as Boolean = False]) as Long
FieldIndex The index of field from attribute table based on which values the categories are generated.
Method the algorythm used to find position for label placement.
SelectedOnly If set to true then the labels will be generated only for selected shapes from the parent shapefile. Default value = false.
LargestPartOnly If true is set then the label will be generated only for the largest part of each shape.
lpCenter = 0 Is used for polygons.
lpCentroid = 1 Is used for polygons.
lpInteriorPoint = 2 Is used for polygons.
lpFirstSegement = 3 Is used for polylines.
lpLastSegment = 4 Is used for polylines.
lpMiddleSegment = 5 Is used for polylines.
lpLongestSegment = 6 Is used for polylines.
C# : public virtual MapWinGis.Labels Labels { set; get; }
VB6: Property Labels as Labels