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.filter.equalTo('name', 'New York')
});Or to combine a BBOX filter with a PropertyIsLike filter:
var f = ol.format.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
- Contains
- During
- EqualTo
- Filter
- GreaterThan
- GreaterThanOrEqualTo
- Intersects
- IsBetween
- IsLike
- IsNull
- LessThan
- LessThanOrEqualTo
- LogicalNary
- Not
- NotEqualTo
- Or
- Spatial
- Within
Methods
-
Create a logical
<And>operator between two or more filter conditions.Name Type Description conditionsol.format.filter.Filter Filter conditions.
Returns:
<And>operator.
-
ol.format.filter.bbox(geometryName, extent, opt_srsName){ol.format.filter.Bbox}
src/ol/format/filter.js, line 71 -
Create a
<BBOX>operator to test whether a geometry-valued property intersects a fixed bounding boxName Type Description geometryNamestring Geometry name to use.
extentol.Extent Extent.
srsNamestring SRS name. No srsName attribute will be set on geometries when this is not provided.
Returns:
<BBOX>operator.
-
ol.format.filter.between(propertyName, lowerBoundary, upperBoundary){ol.format.filter.IsBetween}
src/ol/format/filter.js, line 224 -
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 propertyNamestring Name of the context property to compare.
lowerBoundarynumber The lower bound of the range.
upperBoundarynumber The upper bound of the range.
Returns:
<PropertyIsBetween>operator.
-
ol.format.filter.contains(geometryName, geometry, opt_srsName){ol.format.filter.Contains}
src/ol/format/filter.js, line 86 -
Create a
<Contains>operator to test whether a geometry-valued property contains a given geometry.Name Type Description geometryNamestring Geometry name to use.
geometryol.geom.Geometry Geometry.
srsNamestring SRS name. No srsName attribute will be set on geometries when this is not provided.
Returns:
<Contains>operator.
-
ol.format.filter.during(propertyName, begin, end){ol.format.filter.During}
src/ol/format/filter.js, line 261 -
Create a
<During>temporal operator.Name Type Description propertyNamestring Name of the context property to compare.
beginstring The begin date in ISO-8601 format.
endstring The end date in ISO-8601 format.
Returns:
<During>operator.
-
ol.format.filter.equalTo(propertyName, expression, opt_matchCase){ol.format.filter.EqualTo}
src/ol/format/filter.js, line 130 -
Creates a
<PropertyIsEqualTo>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionstring | number The value to compare.
matchCaseboolean Case-sensitive?
Returns:
<PropertyIsEqualTo>operator.
-
ol.format.filter.greaterThan(propertyName, expression){ol.format.filter.GreaterThan}
src/ol/format/filter.js, line 183 -
Creates a
<PropertyIsGreaterThan>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionnumber The value to compare.
Returns:
<PropertyIsGreaterThan>operator.
-
ol.format.filter.greaterThanOrEqualTo(propertyName, expression){ol.format.filter.GreaterThanOrEqualTo}
src/ol/format/filter.js, line 196 -
Creates a
<PropertyIsGreaterThanOrEqualTo>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionnumber The value to compare.
Returns:
<PropertyIsGreaterThanOrEqualTo>operator.
-
ol.format.filter.intersects(geometryName, geometry, opt_srsName){ol.format.filter.Intersects}
src/ol/format/filter.js, line 101 -
Create a
<Intersects>operator to test whether a geometry-valued property intersects a given geometry.Name Type Description geometryNamestring Geometry name to use.
geometryol.geom.Geometry Geometry.
srsNamestring SRS name. No srsName attribute will be set on geometries when this is not provided.
Returns:
<Intersects>operator.
-
Creates a
<PropertyIsNull>comparison operator to test whether a property value is null.Name Type Description propertyNamestring Name of the context property to compare.
Returns:
<PropertyIsNull>operator.
-
ol.format.filter.lessThan(propertyName, expression){ol.format.filter.LessThan}
src/ol/format/filter.js, line 157 -
Creates a
<PropertyIsLessThan>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionnumber The value to compare.
Returns:
<PropertyIsLessThan>operator.
-
ol.format.filter.lessThanOrEqualTo(propertyName, expression){ol.format.filter.LessThanOrEqualTo}
src/ol/format/filter.js, line 170 -
Creates a
<PropertyIsLessThanOrEqualTo>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionnumber The value to compare.
Returns:
<PropertyIsLessThanOrEqualTo>operator.
-
ol.format.filter.like(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase){ol.format.filter.IsLike}
src/ol/format/filter.js, line 245 -
Represents a
<PropertyIsLike>comparison operator that matches a string property value against a text pattern.Name Type Description propertyNamestring Name of the context property to compare.
patternstring Text pattern.
wildCardstring Pattern character which matches any sequence of zero or more string characters. Default is '*'.
singleCharstring pattern character which matches any single string character. Default is '.'.
escapeCharstring Escape character which can be used to escape the pattern characters. Default is '!'.
matchCaseboolean Case-sensitive?
Returns:
<PropertyIsLike>operator.
-
Represents a logical
<Not>operator for a filter condition.Name Type Description conditionol.format.filter.Filter Filter condition.
Returns:
<Not>operator.
-
ol.format.filter.notEqualTo(propertyName, expression, opt_matchCase){ol.format.filter.NotEqualTo}
src/ol/format/filter.js, line 144 -
Creates a
<PropertyIsNotEqualTo>comparison operator.Name Type Description propertyNamestring Name of the context property to compare.
expressionstring | number The value to compare.
matchCaseboolean Case-sensitive?
Returns:
<PropertyIsNotEqualTo>operator.
-
Create a logical
<Or>operator between two or more filter conditions.Name Type Description conditionsol.format.filter.Filter Filter conditions.
Returns:
<Or>operator.
-
ol.format.filter.within(geometryName, geometry, opt_srsName){ol.format.filter.Within}
src/ol/format/filter.js, line 116 -
Create a
<Within>operator to test whether a geometry-valued property is within a given geometry.Name Type Description geometryNamestring Geometry name to use.
geometryol.geom.Geometry Geometry.
srsNamestring SRS name. No srsName attribute will be set on geometries when this is not provided.
Returns:
<Within>operator.
OpenLayers