Skip to content

StyleExpressions

Namespace: ThinkGeo.Core.Styling

The expressions of the style specification that a layer is most often given, written from code: which features a layer draws, and a colour that depends on a value. Each call makes a fresh node, because a node belongs to the one document it is put in.

public static class StyleExpressions

Inheritance object → StyleExpressions

Methods

Get(string)

A feature's value in a column.

public static JsonNode Get(string column)

Parameters

column string

Returns

JsonNode

Text(string)

A feature's value in a column, as text - the form a value is compared in.

public static JsonNode Text(string column)

Parameters

column string

Returns

JsonNode

FirstOf(String[])

The first of several columns that has a value.

public static JsonNode FirstOf(String[] columns)

Parameters

columns String[]

Returns

JsonNode

Equal(string, string)

Features whose value in a column is the text given.

public static JsonNode Equal(string column, string value)

Parameters

column string

value string

Returns

JsonNode

In(string, String[])

Features whose value in a column is any of the texts given.

public static JsonNode In(string column, String[] values)

Parameters

column string

values String[]

Returns

JsonNode

Contains(string, string)

Features whose value in a column contains the text given.

public static JsonNode Contains(string column, string text)

Parameters

column string

text string

Returns

JsonNode

Has(string)

Features that have a value in a column.

public static JsonNode Has(string column)

Parameters

column string

Returns

JsonNode

Number(string)

A feature's value in a column, as a number - the form a value is measured in.

public static JsonNode Number(string column)

Parameters

column string

Returns

JsonNode

GreaterThan(string, double)

Features whose value in a column, read as a number, is greater than the one given.

public static JsonNode GreaterThan(string column, double value)

Parameters

column string

value double

Returns

JsonNode

GreaterThanOrEqual(string, double)

Features whose value in a column, read as a number, is the one given or greater.

public static JsonNode GreaterThanOrEqual(string column, double value)

Parameters

column string

value double

Returns

JsonNode

LessThan(string, double)

Features whose value in a column, read as a number, is less than the one given.

public static JsonNode LessThan(string column, double value)

Parameters

column string

value double

Returns

JsonNode

LessThanOrEqual(string, double)

Features whose value in a column, read as a number, is the one given or less.

public static JsonNode LessThanOrEqual(string column, double value)

Parameters

column string

value double

Returns

JsonNode

GeometryType(WellKnownType)

Features whose geometry is of a kind. The specification knows three - point, line and polygon - and counts a multi-part geometry as its kind, so WellKnownType.Multipolygon asks the same as WellKnownType.Polygon.

public static JsonNode GeometryType(WellKnownType type)

Parameters

type WellKnownType
A point, line or polygon type, single or multi.

Returns

JsonNode

Not(JsonNode)

Features that do not satisfy an expression.

public static JsonNode Not(JsonNode expression)

Parameters

expression JsonNode

Returns

JsonNode

All(JsonNode[])

Features that satisfy every expression.

public static JsonNode All(JsonNode[] expressions)

Parameters

expressions JsonNode[]

Returns

JsonNode

Any(JsonNode[])

Features that satisfy any expression.

public static JsonNode Any(JsonNode[] expressions)

Parameters

expressions JsonNode[]

Returns

JsonNode

ColorByValue(string, IEnumerable<KeyValuePair<string, GeoColor>>, GeoColor)

A colour picked by a feature's value in a column: the colour paired with the value, or the fallback for a value not listed. What a value style says, in the words the browser reads.

public static JsonNode ColorByValue(string column, IEnumerable<KeyValuePair<string, GeoColor>> colors, GeoColor fallback)

Parameters

column string

colors IEnumerable<KeyValuePair<string, GeoColor>>

fallback GeoColor

Returns

JsonNode

ColorByRange(string, IEnumerable<ColorStop>, bool)

A colour picked by a feature's number in a column, from stops in the data's own units - the stops GridFillStyle.ColorStops takes. A value below the first stop takes its colour, above the last the last's; between two it blends, or with holds the lower stop's colour up to the next - classes.

public static JsonNode ColorByRange(string column, IEnumerable<ColorStop> stops, bool stepped)

Parameters

column string
The column the number is in.

stops IEnumerable<ColorStop>
The values and their colours.

stepped bool
True for classes, false for a blend.

Returns

JsonNode

Css(GeoColor)

A colour the way style JSON writes one.

public static string Css(GeoColor color)

Parameters

color GeoColor

Returns

string