public class MBFilter extends Object
This wrapper class is used by MBObjectParser
to generate rule filters when
transforming MBStyle.
This wrapper and MBFunction
are a matched set handling data expression.
Implementation Note: The value for any filter may be specified as an data expression. The result type of an data expression in
the filter property must be boolean. See MBExpression
for details.
The expressions in this section can be used to add conditional logic to your styles. For example, the 'case' expression provides "if/then/else" logic, and 'match' allows you to map specific values of an input expression to different output expressions.
["!", boolean]: boolean
["!=", value, value]: boolean
</code>
<=
==
>
>=
all
any
case
coalesce
match
within
Implementation Note: GeoTools also supports the depreciated syntax documented here (provided by a previous versions of the Mapbox style specification).
A filter selects specific features from a layer. A filter is an array of one of the following forms:
Existential Filters
["has", key]
- feature[key] exists
["!has", key]
- feature[key] does not exist
Comparison Filters:
Set Membership Filters:
Combining Filters:
A key must be a string that identifies a feature property, or one of the following special keys:
Filter
,
MBFunction
,
MBExpression
Modifier and Type | Field and Description |
---|---|
protected FilterFactory2 |
ff |
protected JSONArray |
json
Wrapped json
|
protected MBObjectParser |
parse
Parser context.
|
protected SemanticType |
semanticType
Default semanticType (or null for "geometry").
|
static String |
TYPE_LINE |
static String |
TYPE_POINT |
static String |
TYPE_POLYGON |
Constructor and Description |
---|
MBFilter(JSONArray json) |
MBFilter(JSONArray json,
MBObjectParser parse) |
MBFilter(JSONArray json,
MBObjectParser parse,
SemanticType semanticType) |
Modifier and Type | Method and Description |
---|---|
Filter |
filter()
Generate GeoTools
Filter from json definition. |
Set<SemanticType> |
semanticTypeIdentifiers()
Translate "$type": the feature type we need This key may be used with the "==", "!
|
public static final String TYPE_POINT
public static final String TYPE_LINE
public static final String TYPE_POLYGON
protected final SemanticType semanticType
protected final MBObjectParser parse
protected final FilterFactory2 ff
protected final JSONArray json
public MBFilter(JSONArray json)
public MBFilter(JSONArray json, MBObjectParser parse)
public MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType)
public Set<SemanticType> semanticTypeIdentifiers()
Copyright © 1996–2022 Geotools. All rights reserved.