Skip to content

RegexItem

Namespace: ThinkGeo.Core

This class represents a single Regex Match statement and styles to draw.

public class RegexItem

Inheritance ObjectRegexItem

Remarks:

The RegexItem represents a single matching criteria for a RegexStyle.

RegexStyle:

The RegexStyle allows you to use complex regular expression matching to determine how your features are drawn. A regular expression is a matching syntax that allows you to match a string based on very complex criteria. For example, let's say you have a layer that has a column in the data that contains school names. Most school names include the type of school they are. For instance, you may have "Lincoln Middle School" or "Bush High School." There are variations to these names though, containing words such as "Elementary" or "Prep." With a regular expression, you can create matching criteria that will allow you to match on many variations of the names. It is especially useful for fuzzy matches where your data is not clearly categorized. Another classic example is for matching or validating email addresses, where matching rules can become complex.

In the RegexStyle, you specify the matching criteria string and also the style you want to use to draw the feature if the criteria matches. It is a simple yet powerful style for dealing with complex rule sets and imprecise data.

Properties

RegularExpression

This property gets and sets the regular expression text used for matching.

public string RegularExpression { get; set; }

Property Value

String
This property gets the regular expression text used for matching.

Remarks:

This should be a valid regular expression string. Formatting regular expression strings is outside the scope of this documentation; however, there are many useful resources on the web for learning about regular expressions.

CustomStyles

This property gets the collection of custom styles.

public Collection<Style> CustomStyles { get; }

Property Value

Collection<Style>
This property gets the collection of custom styles.

Remarks:

The custom styles allow you to use styles other than the default style properties of the class. In this way, you can use a DotDensityStyle or any other style in the API.

DefaultAreaStyle

This property gets and sets the default AreaStyle. You should use this style if your features are area-based.

public AreaStyle DefaultAreaStyle { get; set; }

Property Value

AreaStyle
This property gets the default AreaStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultLineStyle

This property gets and sets the default LineStyle. You should use this style if your features are line-based.

public LineStyle DefaultLineStyle { get; set; }

Property Value

LineStyle
This property gets the default LineStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultPointStyle

This property gets and sets the default PointStyle. You should use this style if your features are point-based.

public PointStyle DefaultPointStyle { get; set; }

Property Value

PointStyle
This property gets the default LineStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

DefaultTextStyle

This property gets and sets the default TextStyle. You should use this style if your features are text-based (such as labels).

public TextStyle DefaultTextStyle { get; set; }

Property Value

TextStyle
This property gets the default TextStyle.

Remarks:

The default style allows you to directly set properties on the styles without having to create a new style each time. You can start simply by setting properties like color, etc. This makes modifying styles very easy.

Constructors

RegexItem()

This is a constructor for the class.

public RegexItem()

Remarks:

If you use this constructor, you should set the necessary properties manually.

RegexItem(String, AreaStyle)

This is a constructor for the class.

public RegexItem(string regularExpression, AreaStyle areaStyle)

Parameters

regularExpression String

        This parameter is the regular expression statement you would like to
        match.

areaStyle AreaStyle

        This parameter is the style you want to draw with if the regular expression
        matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultAreaStyle.

RegexItem(String, LineStyle)

This is a constructor for the class.

public RegexItem(string regularExpression, LineStyle lineStyle)

Parameters

regularExpression String

        This parameter is the regular expression statement you would like to
        match.

lineStyle LineStyle

        This parameter is the style you want to draw with if the regular expression
        matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultLineStyle.

RegexItem(String, PointStyle)

This is a constructor for the class.

public RegexItem(string regularExpression, PointStyle pointStyle)

Parameters

regularExpression String

        This parameter is the regular expression statement you would like to
        match.

pointStyle PointStyle

        This parameter is the style you want to draw with if the regular expression
        matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultPointStyle.

RegexItem(String, TextStyle)

This is a constructor for the class.

public RegexItem(string regularExpression, TextStyle textStyle)

Parameters

regularExpression String

        This parameter is the regular expression statement you would like to
        match.

textStyle TextStyle

        This parameter is the style you want to draw with if the regular expression
        matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the DefaultTextStyle.

RegexItem(String, Collection<Style>)

This is a constructor for the class.

public RegexItem(string regularExpression, Collection<Style> styles)

Parameters

regularExpression String

        This parameter is the regular expression statement you would like to
        match.

styles Collection<Style>

        This parameter represents the styles you want to draw with if the regular expression
        matches.

Remarks:

It is recommended that you do not use this constructor unless it is absolutely necessary. Instead, you can set the properties directly on the CustomStyles.