Property Editor - Class Object
The Class Property Editor provides a dialogue to edit the properties of a class object. Each layer can have one or more classes that are able to provide a subset of the features in the layer and allow distinct symology and label styles. Each class can have multiple style objects and multiple label objects. The Class Property Editor contains a preview window to show how the class will be rendered.
The properties of the Class Property Editor are divided into the groups, each group is represented by a separate tab sheet. The Class Property Editor contains the following property groups and parameters:
The General tab allows you to set the general properties of the class object.
- Class Name - The formatted display name for the class. If not set class won’t show up in the legend
- Title - The general description of the class
- Text - Text label expression to label class features. This overrides values obtained from the Label Item in the Layer Property Editor. The string may be given as an expression delimited using the ()’s. This allows you to concatenate multiple attributes into a single label. For example:
('[FIRSTNAME]' + ',' + '[LASTNAME]')
For more information about the expression handling see MapServer Expressions
- Expression - A filter expression provides the conditions to determine which features belong to this class. Four types of expressions are supported: String comparisons, regular expressions, simple logical expressions, and string functions. If no expression is given, then all features are said to belong to this class. For more information about the expression handling see MapServer Expressions
- String comparisons are case sensitive and are the fastest to evaluate. No special delimiters are necessary although strings must be quoted if they contain special characters. (As a matter of good habit, it is recommended you quote all strings)
- Regular expressions function just like previous versions of MapServer. However, you must now delimit a regular expression using /regex/. No quotes should be used
- Logical expressions allow you to build fairly complex tests based on one or more attributes and therefore are only available with shapefiles. Logical expressions are delimited by parentheses “(expression)”. Attribute names are delimited by square brackets
These names are case sensitive and must match the items in the shapefile. For example:
([POPULATION] > 50000 AND ‘[LANGUAGE]’ eq ‘FRENCH’) ...
The following logical operators are supported: =,>,<,<=,>=,=,or,and,lt,gt,ge,le,eq,ne. As you might expect this level of complexity is slower to process.
- One string function exists: length(). This obviously computes the length of a string. An example follows:
(length('[NAME_E]') < 8)
String comparisons and regular expressions work from the classitem defined at the layer level. You may mix expression types within the different classes of a layer.
The Display tab provides properties related to the rendering behaviour of the class
- Visible - Enable or disable the visibility flag of the class
- Queryable - Enable or disable the query flag of the class. Only queryable features can be selected by using the MapManager Feature Selection operations
- Closest scale - The closest scale at which the class is drawn when setting up the scale dependent rendering. Clicking on the button we can set the current scale of the map
- Farthest scale - The farthest scale at which the class is drawn when setting up the scale dependent rendering. Clicking on the button we can set the current scale of the map