Data Filters
Many requests (both Visual and Query) let you filter the list of features to be returned based on the data associated with the features. Data filters have the following format:
<field>__<operator>:<value>
field can be a built-in field or an attribute field, like "snowfall_monthly.place_data.snowfall_novavg".
value can be one of the following:
| Data type | Syntax | Example |
|---|---|---|
| Boolean | t, f, True, False | |
| String | Single quoted string | 'Hoboken' |
| Numeric | Unquoted number | 15.4 |
| List | comma-separated values inside '[]' | ['a','b'] [0,1] |
List values only make sense with the 'in' operator, see below.
operator is one the following:
| Operator | SQL Equivalent | Meaning | Inverse |
|---|---|---|---|
| exact | = | case-sensitive equals | nexact |
| iexact | LIKE | case-insensitive equals | niexact |
| contains | LIKE "%...%" | case-sensitive contains string | ncontains |
| icontains | LIKE "%...%" | case-insensitive contains string | nicontains |
| startswith | LIKE "...%" | case-sensitive starts with string | nstartswith |
| istartswith | ILIKE "...%" | case-insensitive starts with string | nistartswith |
| endswith | LIKE "%..." | case-sensitive ends with string | nendswith |
| iendswith | ILIKE "%..." | case-insensitive ends with string | niendswith |
| isnull | "IS NULL" | is a null value | nnull |
| gt | > | greater than | |
| gte | >= | greater than or equal | |
| lt | < | less than | |
| lte | <= | less than or equal | |
| in | IN | in (takes an list argument) | nin |
You can use inverses like any operator and they have the same meaning as NOT in SQL (e.g. NOT IN or NOT LIKE).
The following filter will restrict results to features with more than 10,000 homeowners:
us_census00.stats.cnt_hhoo__gt:10000
The following filter will restrict results to features whose name doesn't start with 'A':
name__nstartswith:'A'