Class MBFilter
- Object
- 
- MBFilter
 
- 
 public class MBFilter extends Object MBFilter json wrapper, allowing conversion to a GeoTools Filter.This wrapper class is used by MBObjectParserto generate rule filters when transforming MBStyle.This wrapper and MBFunctionare a matched set handling data expression.Data expression: DecisionImplementation 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 MBExpressionfor 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
 Filter OtherImplementation 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: - ["==", key, value] equality: feature[key] = value
- ["!=", key, value] inequality: feature[key] ≠ value
- [">", key, value] greater than: feature[key] > value
- [">=", key, value] greater than or equal: feature[key] ≥ value
- ["<", key, value] less than: feature[key] < value
- ["<=", key, value] less than or equal: feature[key] ≤ value
 Set Membership Filters: - ["in", key, v0, ..., vn] set inclusion: feature[key] ∈ {v0, ..., vn}
- ["!in", key, v0, ..., vn] set exclusion: feature[key] ∉ {v0, ..., vn}
 Combining Filters: - ["all", f0, ..., fn] logical AND: f0 ∧ ... ∧ fn
- ["any", f0, ..., fn] logical OR: f0 ∨ ... ∨ fn
- ["none", f0, ..., fn] logical NOR: ¬f0 ∧ ... ∧ ¬fn
 A key must be a string that identifies a feature property, or one of the following special keys: - "$type": the feature type. This key may be used with the "==", "!=", "in", and "!in" operators. Possible values are "Point", "LineString", and "Polygon".
- "$id": the feature identifier. This key may be used with the "==", "!=", "has", "!has", "in", and "!in" operators.
 - See Also:
- Filter,- MBFunction,- MBExpression
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected FilterFactoryffprotected JSONArrayjsonWrapped jsonprotected MBObjectParserparseParser context.protected SemanticTypesemanticTypeDefault semanticType (or null for "geometry").static StringTYPE_LINEstatic StringTYPE_POINTstatic StringTYPE_POLYGON
 - 
Constructor SummaryConstructors Constructor Description MBFilter(JSONArray json)MBFilter(JSONArray json, MBObjectParser parse)MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Filterfilter()Generate GeoToolsFilterfrom json definition.Set<SemanticType>semanticTypeIdentifiers()Translate "$type": the feature type we need This key may be used with the "==", "!
 
- 
- 
- 
Field Detail- 
TYPE_POINTpublic static final String TYPE_POINT - See Also:
- Constant Field Values
 
 - 
TYPE_LINEpublic static final String TYPE_LINE - See Also:
- Constant Field Values
 
 - 
TYPE_POLYGONpublic static final String TYPE_POLYGON - See Also:
- Constant Field Values
 
 - 
semanticTypeprotected final SemanticType semanticType Default semanticType (or null for "geometry").
 - 
parseprotected final MBObjectParser parse Parser context.
 - 
ffprotected final FilterFactory ff 
 - 
jsonprotected final JSONArray json Wrapped json
 
- 
 - 
Constructor Detail- 
MBFilterpublic MBFilter(JSONArray json) 
 - 
MBFilterpublic MBFilter(JSONArray json, MBObjectParser parse)
 - 
MBFilterpublic MBFilter(JSONArray json, MBObjectParser parse, SemanticType semanticType)
 
- 
 - 
Method Detail- 
semanticTypeIdentifierspublic Set<SemanticType> semanticTypeIdentifiers() Translate "$type": the feature type we need This key may be used with the "==", "!=", "in", and "!in" operators. Possible values are "Point", "LineString", and "Polygon".- Returns:
- Set of GeoTools SemanticType (Point, LineString, Polygon).
 
 
- 
 
-