Non-Spatial Filtering
In addition to restricting data load based on geometric filtering, you can restrict data load based on non-spatial expressions.
A Non-Spatial filter is configured within an open data task, with the filter having to be entered manually. Non-spatial filtering can also be applied to a Schema transform task, for more see Schema Transform.
Some examples of possible filters and further syntax information can be found below.
Note: The Non-Spatial filter works much like a SQL WHERE clause, though is syntactically different.
Note: Both {} and () can be used for filters. {} are recommended as it will allow differentiation between the filters and functions with the same name. e.g. NUMBER{} and NUMBER().
Non-spatial filtering can be used to filter and restrict data using a number of syntax options, some examples of filters that can be defined are as follows:
Example: Class Filters
To find all features in the classes called BUILDING
and ROAD
with an ID of 500, and all features in a class called FIRE_STATION
with an ID of 750:
BUILDING|ROAD{ID==500},FIRE_STATION{ID==750}
Example: Filtering a common attribute
In the following example the attribute HEIGHT
is shared across all classes.
HEIGHT == 50 || HEIGHT == 60
All HEIGHT
attributes with the value 50 or 60 will be filtered across all Classes.
Example: Excluding classes from filter
In this example the filter checks for all ID attributes with a value of 50. This filter is applied to each class, except for BUILDING
.
!BUILDING{ID==50}
Note: For this example, all classes except BUILDING require an ID field or it will not work.
Example: Session Parameter Values
If you have defined a session parameter value you can use these as part of a filter.
{ORGANISATION==$ORG_SESSION_PARAM}
In this instance you are filtering ORGANISATION
values that are equal to the defined session parameter value {ORG_SESSION_PARAM}
.
Note: You must prefix your session parameter reference with "$
".
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.
Example: Date
To find the features across all classes that have a date value after February 2012. The 'yyyy-MM'
string supplied represents the date format pattern 1integrate should use to interpret the given date.
Filter Syntax
The following tables contain the syntax that can be used to create the non-spatial filters.
Note: Class filters are optional and if omitted the filters will run on all classes.
Class Filter | Description |
---|---|
No class provided | If no class is preceding values or operators then the filter will run on all classes. |
| | Separated list of classes. |
! | Run on all classed except for a specific example. |
Constant Values | Description |
---|---|
Numbers | Including whole numbers and decimals e.g. 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"'. |
Boolean Values | True/False |
Null | No value. |
Variable Values | Description |
---|---|
Object Column Names | The name of the column in the table containing the object. |
Session Parameter Values | For more on Session Parameter Values, see Values. |
Supported Operator |
Description |
---|---|
Boolean Operators | |
&& |
This is an AND operator. |
|| |
This is an OR operator. |
! |
This is a NOT operator and negates the proceeding expression. |
String Operators | |
== | Equals to operator. |
!= | Not equal to operator. |
+ | Concatenate two strings |
Numeric Operators | |
>= | Greater than or equal to operator. |
<= | Less than or equal to. |
> | Greater than operator |
< | Less than operator. |
== | Equal to operator. |
!= | Not equal to operator. |
+ | Add two numerical values. |
- | Subtract two numerical values. |
^ | To the power of. Use numerical values with this operator to multiply the value by itself. |
% | Modulo operator. |
* | Multiplication operator. |
/ | Division operator. |
Function | Description |
---|---|
Numeric Functions | |
min(x, y) | Return the minimum of 2 numbers. |
max(x, y) | Return the maximum of 2 numbers |
round(x) | Return the number rounded to the nearest whole integer. |
floor(x) | Return the floor of the number (nearest whole integer, rounded down) |
ceil(x) | Return the ceiling of the of the number (nearest whole integer, rounded down) |
clamp(x, y, z) | Return first number clamped between second and third number. |
String Functions | |
contains(string1, string2) | Return true if first string contains the second. |
remove(string1, string2) | Return first string with the second string removed from it. |
replace(string1, string2) | Return first string with all instances of second string replaced with third string. |
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: |
string(x + y + z) |
Return a string of the combined total of the parsed numbers. e.g. string(1+2+3) returns “6” as a string. For use in string attribute comparisons. |
number(x + y) |
Return the input concatenated as a number. e.g. number('300' + '1') returns 3001 as a number. For use in numerical attribute comparisons. |