Non-Spatial Filtering

In addition to restricting the data load based on geometric filtering, you can restrict data load based on non-spatial expressions.

Non-spatial filtering can be applied to Open Data Task, Check Rules Task, Apply Actions Task, and Apply Action Maps Task. A Non Spatial Filter is configured on each of the task types, with the filter either selected from a number of default options, or having to be entered manually.

A screenshot showing the Non-Spatial Filter defined in the Session Settings Dialogue.
A Configured Non Spatial Filter

     Note: Non-Spatial filters work much like a SQL WHERE clause, though is syntactically different.

Brackets "()" can be used to group expressions together to control the order of operations (BODMAS).

     Example: ID == 1 + 2 * 3 will check that the ID is equal to 7, while ID == (1 + 2) * 3 will check that the ID is equal to 9.

Class Filters and Filter Syntax can be found in the tables below along with examples.

     Note: Class and Attribute names are case sensitive when using a Non-Spatial filter.

Class Filters

     Note: Class filters are optional and if omitted the filters will run on all classes.

By default, filters run on all classes. However, if your attributes are not the same across classes, this may cause the filter to fail to apply.

You may want to only filter specific classes, and load all the data from all other classes.

     Example: CLASS1|CLASS2|CLASS3{filter} will apply the 'filter' to only the classes CLASS1, CLASS2, and CLASS3.

You can also filter everything out except for the specified classes.

     Example: !CLASS1{filter} will apply the 'filter' to all classes except CLASS1.

Multiple class filters can be applied at once by separating them with commas.

     Example: CLASS1{filter1},CLASS2|CLASS3{filter2},filter3, this will apply 'filter1' to CLASS1, 'filter2' to CLASS2, and CLASS3, and 'filter3' to all classes (including CLASS1, CLASS2, and CLASS3).

     Note: Any classes not covered by the filters will be loaded as though there was no filter.

Filter Syntax

The following tables contain the syntax that can be used to create the non-spatial filters.

Constant Values

Constant Values

Description

Example

Numbers

Whole numbers and decimals.

1

1.4

0.12

Strings

Both ' and " can be used to denote strings so you can include the other character in the string itself. e.g. if you want to use " in the string, open the string with ': '"Example"'.

'Text'

"Text"

"Text that has 'quotes'"

Boolean Values

True/False.

true

false

Null

No value.

null

Variables

Variable Values

Description

Example

Attribute Names

The name of the attribute in an object. If the source Data Store is case sensitive (e.g. a database) then this is also case sensitive.

ID < 20

Check that the value of the ID attribute is less than 20

 

Type == "ROAD"

Check that the TYPE attribute is equal to the string "ROAD".

Session Parameter Values

Session Parameter Values can be referenced by using the Value name, prefixed with a $.

     Note: Spaces in the name of the Session Parameter reference will need to be converted to underscores in the filter. It is also case sensitive.

For more on Session Parameter Values, see Values.

ORGANISATION == $ORG_SESSION_PARAM

Check that the ORGANISATION attribute is equal to the value of the ORG_SESSION_PARAM session parameter.

Operators

Supported Operator

Description

Example

Boolean Operators

&&

This is an AND operator.

ID > 5 && ID < 10

Check that the ID attribute is greater than 5 and less than 10.

||

This is an OR operator.

TYPE == "TRAIN" || TYPE == "BUS"

Check that the TYPE attribute is equal to "TRAIN" or equal to "BUS".

!

This is a NOT operator and negates the proceeding expression.

!contains(TYPE, "FIRE")

Check that the TYPE attribute does not contain "FIRE".

String Operators

==

Equals to operator.

TYPE == "FIRE"

Check that the TYPE attribute is the string "FIRE".

!=

Not equal to operator.

TYPE != "FIRE"

Check that the TYPE attribute is not the string "FIRE".

+

Concatenate two strings.

TYPE == ("BUS" + "STATION")

Check that the TYPE attribute is the string "BUSSTATION"

 

TYPE == (DTYPE + "INTERNAL")

Check that the TYPE attribute is equal to the value of the DTYPE attribute with "INTERNAL" concatenated to the end.

Numeric Operators

>=

Greater than or equal to operator.

ID >= 5

Check that the ID attribute is greater than or equal to 5.

<=

Less than or equal to.

ID <= 5

Check that the ID attribute is less than or equal to 5.

>

Greater than operator.

ID > 5

Check that the ID attribute is greater than 5.

<

Less than operator.

ID < 5

Check that the ID attribute is less than 5.

==

Equal to operator.

ID == 5

Check that the ID attribute is equal to 5.

!=

Not equal to operator.

ID == 5

Check that the ID attribute is not equal to 5.

+

Add two numerical values.

ID == 5 + 5

Check that the ID attribute is equal to 10.

-

Subtract two numerical values.

ID == 5 - 5

Check that the ID attribute is equal to 0.

^

To the power of. Use numerical values with this operator to multiply the value by itself.

ID == 5 ^ 2

Check that the ID attribute is equal to 25.

%

Modulo operator.

ID == 25 % 5

Check that the ID attribute is equal to 0.

*

Multiplication operator.

ID == 5 * 5

Check that the ID attribute is equal to 25.

/

Division operator.

ID == 25 / 5

Check that the ID attribute is equal to 5.

Functions

Function

Description

Example

Numeric Functions

min(x, y)

Return the minimum of 2 numbers.

SIZE > min($size, 5)

Check that the SIZE attribute is greater than the minimum of the size session parameter, or 5.

max(x, y)

Return the maximum of 2 numbers.

SIZE > max($size, 5)

Check that the SIZE attribute is greater than the maximum of the size session parameter, or 5.

round(x)

Return the number rounded to the nearest whole integer.

SIZE == round(WIDTH / 2)

Check that the SIZE attribute is equal to the WIDTH attribute divided by 2, rounded to the nearest whole number.

floor(x)

Return the floor of the number (nearest whole integer, rounded down).

SIZE == floor(WIDTH / 2)

Check that the SIZE attribute is equal to the WIDTH attribute divided by 2, rounded down to the nearest whole number.

ceil(x)

Return the ceiling of the of the number (nearest whole integer, rounded down).

SIZE == ceil(WIDTH / 2)

Check that the SIZE attribute is equal to the WIDTH attribute divided by 2, rounded up to the nearest whole number.

clamp(x, y, z)

Return first number clamped between second and third number.

SIZE == clamp(WIDTH, 0, 100)

Check that the SIZE attribute is equal to the WIDTH attribute, clamped between 0 and 100.

String Functions

contains(string1, string2)

Return true if first string contains the second.

contains(TYPE, "FIRE")

Check that the TYPE attribute contains the substring "FIRE".

remove(string1, string2)

Return first string with the second string removed from it.

remove(TYPE, ID) == "BUILDING"

Check that the TYPE attribute is equal to "BUILDING" once the ID has been removed from it.

replace(string1, string2, string3)

Return first string with all instances of second string replaced with third string.

replace(TYPE, ID, "_") == "BUILDING_"

Check that the TYPE attribute is equal to "BUILDING_" once all instances of the ID have been replaced with "_".

Casting Functions

date(string1, string2)

Parses the first string as a date with the second string supplied representing the date format pattern 1Integrate should use to interpret the given date.

For use in timestamp attribute comparisons.

     Note: Date formats are defined using Java date formats e.g: ddMMyyyy

DATE_CREATED > date('2012-02', 'yyyy-MM')

Check that the DATE_CREATED is after the date february 2012.

string(number)

Convert the given number to a string.

For use in string attribute comparisons.

ID == string($BASE_ID + 3)

Check that the ID attribute is a string equal to the session parameter BASE_ID with 3 added to it, when converted to a string.

number(string)

Convert the given string to a number.

For use in numerical attribute comparisons.

ID == number(ID_CODE + "66")

Check that the ID attribute is equal to the ID_CODE attribute concatenated with the string "66" then converted to a number.