This namespace contains convenience functions to create filters for
ol.format.WFS#writeGetFeature
.
For example to generate a GetFeature
request with a PropertyIsEqualTo
filter:
var request = new ol.format.WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
featureTypes: ['states'],
filter: ol.format.wfs.filter.equalTo('name', 'New York')
});
Or to combine a BBOX
filter with a PropertyIsLike
filter:
var f = ol.format.wfs.filter;
var request = new ol.format.WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
featureTypes: ['states'],
filter: f.and(
f.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'),
f.like('name', 'New*')
)
});
Classes
- And
- Bbox
- Comparison
- ComparisonBinary
- EqualTo
- Filter
- GreaterThan
- GreaterThanOrEqualTo
- IsBetween
- IsLike
- IsNull
- LessThan
- LessThanOrEqualTo
- Logical
- LogicalBinary
- Not
- NotEqualTo
- Or
Methods
-
ol.format.ogc.filter.and(conditionA, conditionB){ol.format.ogc.filter.And} experimental
src/ol/format/ogc/filter.js, line 33 -
Create a logical
<And>
operator between two filter conditions.Name Type Description conditionA
ol.format.ogc.filter.Filter First filter condition.
conditionB
ol.format.ogc.filter.Filter Second filter condition.
Returns:
<And>
operator.
-
ol.format.ogc.filter.bbox(geometryName, extent, opt_srsName){ol.format.ogc.filter.Bbox} experimental
src/ol/format/ogc/filter.js, line 74 -
Create a
<BBOX>
operator to test whether a geometry-valued property intersects a fixed bounding boxName Type Description geometryName
string Geometry name to use.
extent
ol.Extent Extent.
srsName
string SRS name. No srsName attribute will be set on geometries when this is not provided.
Returns:
<BBOX>
operator.
-
ol.format.ogc.filter.between(propertyName, lowerBoundary, upperBoundary){ol.format.ogc.filter.IsBetween} experimental
src/ol/format/ogc/filter.js, line 182 -
Creates a
<PropertyIsBetween>
comparison operator to test whether an expression value lies within a range given by a lower and upper bound (inclusive).Name Type Description propertyName
string Name of the context property to compare.
lowerBoundary
number The lower bound of the range.
upperBoundary
number The upper bound of the range.
Returns:
<PropertyIsBetween>
operator.
-
ol.format.ogc.filter.equalTo(propertyName, expression, opt_matchCase){ol.format.ogc.filter.EqualTo} experimental
src/ol/format/ogc/filter.js, line 88 -
Creates a
<PropertyIsEqualTo>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
string | number The value to compare.
matchCase
boolean Case-sensitive?
Returns:
<PropertyIsEqualTo>
operator.
-
ol.format.ogc.filter.greaterThan(propertyName, expression){ol.format.ogc.filter.GreaterThan} experimental
src/ol/format/ogc/filter.js, line 141 -
Creates a
<PropertyIsGreaterThan>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
number The value to compare.
Returns:
<PropertyIsGreaterThan>
operator.
-
ol.format.ogc.filter.greaterThanOrEqualTo(propertyName, expression){ol.format.ogc.filter.GreaterThanOrEqualTo} experimental
src/ol/format/ogc/filter.js, line 154 -
Creates a
<PropertyIsGreaterThanOrEqualTo>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
number The value to compare.
Returns:
<PropertyIsGreaterThanOrEqualTo>
operator.
-
ol.format.ogc.filter.isNull(propertyName){ol.format.ogc.filter.IsNull} experimental
src/ol/format/ogc/filter.js, line 167 -
Creates a
<PropertyIsNull>
comparison operator to test whether a property value is null.Name Type Description propertyName
string Name of the context property to compare.
Returns:
<PropertyIsNull>
operator.
-
ol.format.ogc.filter.lessThan(propertyName, expression){ol.format.ogc.filter.LessThan} experimental
src/ol/format/ogc/filter.js, line 115 -
Creates a
<PropertyIsLessThan>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
number The value to compare.
Returns:
<PropertyIsLessThan>
operator.
-
ol.format.ogc.filter.lessThanOrEqualTo(propertyName, expression){ol.format.ogc.filter.LessThanOrEqualTo} experimental
src/ol/format/ogc/filter.js, line 128 -
Creates a
<PropertyIsLessThanOrEqualTo>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
number The value to compare.
Returns:
<PropertyIsLessThanOrEqualTo>
operator.
-
ol.format.ogc.filter.like(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase){ol.format.ogc.filter.IsLike} experimental
src/ol/format/ogc/filter.js, line 203 -
Represents a
<PropertyIsLike>
comparison operator that matches a string property value against a text pattern.Name Type Description propertyName
string Name of the context property to compare.
pattern
string Text pattern.
wildCard
string Pattern character which matches any sequence of zero or more string characters. Default is '*'.
singleChar
string pattern character which matches any single string character. Default is '.'.
escapeChar
string Escape character which can be used to escape the pattern characters. Default is '!'.
matchCase
boolean Case-sensitive?
Returns:
<PropertyIsLike>
operator.
-
ol.format.ogc.filter.not(condition){ol.format.ogc.filter.Not} experimental
src/ol/format/ogc/filter.js, line 58 -
Represents a logical
<Not>
operator for a filter condition.Name Type Description condition
ol.format.ogc.filter.Filter Filter condition.
Returns:
<Not>
operator.
-
ol.format.ogc.filter.notEqualTo(propertyName, expression, opt_matchCase){ol.format.ogc.filter.NotEqualTo} experimental
src/ol/format/ogc/filter.js, line 102 -
Creates a
<PropertyIsNotEqualTo>
comparison operator.Name Type Description propertyName
string Name of the context property to compare.
expression
string | number The value to compare.
matchCase
boolean Case-sensitive?
Returns:
<PropertyIsNotEqualTo>
operator.
-
ol.format.ogc.filter.or(conditionA, conditionB){ol.format.ogc.filter.Or} experimental
src/ol/format/ogc/filter.js, line 46 -
Create a logical
<Or>
operator between two filter conditions.Name Type Description conditionA
ol.format.ogc.filter.Filter First filter condition.
conditionB
ol.format.ogc.filter.Filter Second filter condition.
Returns:
<Or>
operator.