The filters block
The filters block contains information on how the layer is being filtered before displaying. In order for a feature to be shown on the map it must evaluate the filter expression to true.
Filters are written using a JSON infix notation that looks like one of [identifier, operator, operand], true or false .
Valid identifiers are either a feature property or a nested expression.
Valid operators are:
"lt"– Less than"gt"– Greater than"le"– Less than or equal to"ge"– Greater than or equal to"eq"– Equal to"ne"– Not equal to"and"– And, cast to boolean"or"– Or, cast to boolean"cn"– Contains the operand, cast to string"nc"– Does not contain the operand, cast to string"in"– Contained in the operand list"ni"– Not contained in the operand list"is"– Used to match against null values"isnt"– Used to match against null values
Operands are:
A numerical value, a string value, a boolean value
An array of numerical, string, or boolean values, a shorthand expanded to these patterns:
Input 1:
[id, "in", [element1, …, elementN]]Expansion 1:
idis equal ("eq") to one or more of the elementsInput 2:
[id, "ni", [element1, …, elementN]]Expansion 2:
idis not equal ("ne") to any of the elementsNot defined for operators other than
"in"and"ni"
A nested expression
In cases of type mismatch cast the identifier value to the operand’s type
Type casting applies element-wise to lists with
"in"and"ni"operators
Behavior notes
Case & diacritics:
eq,ne,gt,ge,lt,le,cn, andnccompare strings case-insensitively and diacritic-insensitively.["status", "eq", "active"]matches"Active"and"ACTIVE".in/niare case-sensitive, unlike the operators above, and do per-element type coercion (["id", "in", [5]]matches a string"5").inwith an empty array always returns false;niwith an empty array always returns true.Null handling: use
is/isntonly for null/existence checks (withnullas the value) — not for value equality. Most other operators yield null (and filter the feature out) when the column is missing or null.Type coercion: the left-hand value is cast to match the right-hand type, so
["score", "eq", 100]matches whether the column stores100or"100".
Common patterns
There is no single "between" operator — combine two comparisons:
Check that a value exists and is non-empty:
Three or more conditions must be written as nested pairs, not a flat list:
Last updated
Was this helpful?