From 78af52d62d4f8f58cba2356930ad33922760b1dd Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 20 Sep 2016 16:51:50 +0200 Subject: [PATCH] Rename ol.format.ogc.filter namespace to ol.format.filter --- changelog/upgrade-notes.md | 5 + examples/vector-wfs-getfeature.js | 8 +- externs/olx.js | 6 +- src/ol/format/filter/and.js | 19 ++ src/ol/format/{ogc => }/filter/bbox.js | 12 +- src/ol/format/{ogc => }/filter/comparison.js | 12 +- .../{ogc => }/filter/comparisonbinary.js | 12 +- src/ol/format/filter/equalto.js | 21 ++ src/ol/format/{ogc => }/filter/filter.js | 6 +- src/ol/format/filter/greaterthan.js | 20 ++ src/ol/format/filter/greaterthanorequalto.js | 20 ++ src/ol/format/filter/index.js | 233 ++++++++++++++++++ src/ol/format/{ogc => }/filter/index.jsdoc | 6 +- src/ol/format/{ogc => }/filter/intersects.js | 12 +- src/ol/format/{ogc => }/filter/isbetween.js | 12 +- src/ol/format/{ogc => }/filter/islike.js | 12 +- src/ol/format/filter/isnull.js | 19 ++ src/ol/format/filter/lessthan.js | 20 ++ src/ol/format/filter/lessthanorequalto.js | 20 ++ src/ol/format/filter/logical.js | 19 ++ src/ol/format/filter/logicalbinary.js | 35 +++ src/ol/format/filter/not.js | 26 ++ src/ol/format/filter/notequalto.js | 21 ++ src/ol/format/filter/or.js | 20 ++ src/ol/format/{ogc => }/filter/spatial.js | 12 +- src/ol/format/{ogc => }/filter/within.js | 12 +- src/ol/format/ogc/filter/and.js | 19 -- src/ol/format/ogc/filter/equalto.js | 21 -- src/ol/format/ogc/filter/greaterthan.js | 20 -- .../format/ogc/filter/greaterthanorequalto.js | 20 -- src/ol/format/ogc/filter/index.js | 233 ------------------ src/ol/format/ogc/filter/isnull.js | 19 -- src/ol/format/ogc/filter/lessthan.js | 20 -- src/ol/format/ogc/filter/lessthanorequalto.js | 20 -- src/ol/format/ogc/filter/logical.js | 19 -- src/ol/format/ogc/filter/logicalbinary.js | 35 --- src/ol/format/ogc/filter/not.js | 26 -- src/ol/format/ogc/filter/notequalto.js | 21 -- src/ol/format/ogc/filter/or.js | 20 -- src/ol/format/wfs.js | 26 +- test/spec/ol/format/wfs.test.js | 44 ++-- 41 files changed, 594 insertions(+), 589 deletions(-) create mode 100644 src/ol/format/filter/and.js rename src/ol/format/{ogc => }/filter/bbox.js (66%) rename src/ol/format/{ogc => }/filter/comparison.js (57%) rename src/ol/format/{ogc => }/filter/comparisonbinary.js (67%) create mode 100644 src/ol/format/filter/equalto.js rename src/ol/format/{ogc => }/filter/filter.js (74%) create mode 100644 src/ol/format/filter/greaterthan.js create mode 100644 src/ol/format/filter/greaterthanorequalto.js create mode 100644 src/ol/format/filter/index.js rename src/ol/format/{ogc => }/filter/index.jsdoc (86%) rename src/ol/format/{ogc => }/filter/intersects.js (51%) rename src/ol/format/{ogc => }/filter/isbetween.js (56%) rename src/ol/format/{ogc => }/filter/islike.js (78%) create mode 100644 src/ol/format/filter/isnull.js create mode 100644 src/ol/format/filter/lessthan.js create mode 100644 src/ol/format/filter/lessthanorequalto.js create mode 100644 src/ol/format/filter/logical.js create mode 100644 src/ol/format/filter/logicalbinary.js create mode 100644 src/ol/format/filter/not.js create mode 100644 src/ol/format/filter/notequalto.js create mode 100644 src/ol/format/filter/or.js rename src/ol/format/{ogc => }/filter/spatial.js (68%) rename src/ol/format/{ogc => }/filter/within.js (52%) delete mode 100644 src/ol/format/ogc/filter/and.js delete mode 100644 src/ol/format/ogc/filter/equalto.js delete mode 100644 src/ol/format/ogc/filter/greaterthan.js delete mode 100644 src/ol/format/ogc/filter/greaterthanorequalto.js delete mode 100644 src/ol/format/ogc/filter/index.js delete mode 100644 src/ol/format/ogc/filter/isnull.js delete mode 100644 src/ol/format/ogc/filter/lessthan.js delete mode 100644 src/ol/format/ogc/filter/lessthanorequalto.js delete mode 100644 src/ol/format/ogc/filter/logical.js delete mode 100644 src/ol/format/ogc/filter/logicalbinary.js delete mode 100644 src/ol/format/ogc/filter/not.js delete mode 100644 src/ol/format/ogc/filter/notequalto.js delete mode 100644 src/ol/format/ogc/filter/or.js diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 7b20d3738b..ce789ed4f2 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -4,6 +4,11 @@ As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files. +#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter` + +`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name. +For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`. + #### Changes only relevant to those who compile their applications together with the Closure Compiler A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following: diff --git a/examples/vector-wfs-getfeature.js b/examples/vector-wfs-getfeature.js index 8761aa3b9e..373f8fea92 100644 --- a/examples/vector-wfs-getfeature.js +++ b/examples/vector-wfs-getfeature.js @@ -1,6 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); -goog.require('ol.format.ogc.filter'); +goog.require('ol.format.filter'); goog.require('ol.format.WFS'); goog.require('ol.format.GeoJSON'); goog.require('ol.layer.Tile'); @@ -46,9 +46,9 @@ var featureRequest = new ol.format.WFS().writeGetFeature({ featurePrefix: 'osm', featureTypes: ['water_areas'], outputFormat: 'application/json', - filter: ol.format.ogc.filter.and( - ol.format.ogc.filter.like('name', 'Mississippi*'), - ol.format.ogc.filter.equalTo('waterway', 'riverbank') + filter: ol.format.filter.and( + ol.format.filter.like('name', 'Mississippi*'), + ol.format.filter.equalTo('waterway', 'riverbank') ) }); diff --git a/externs/olx.js b/externs/olx.js index 84d533739d..a3a78dc84b 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -2014,7 +2014,7 @@ olx.format.WFSOptions.prototype.schemaLocation; * startIndex: (number|undefined), * count: (number|undefined), * bbox: (ol.Extent|undefined), - * filter: (ol.format.ogc.filter.Filter|undefined), + * filter: (ol.format.filter.Filter|undefined), * resultType: (string|undefined)}} */ olx.format.WFSWriteGetFeatureOptions; @@ -2121,8 +2121,8 @@ olx.format.WFSWriteGetFeatureOptions.prototype.bbox; /** - * OGC filter condition. See {@link ol.format.ogc.filter} for more information. - * @type {ol.format.ogc.filter.Filter|undefined} + * Filter condition. See {@link ol.format.filter} for more information. + * @type {ol.format.filter.Filter|undefined} * @api */ olx.format.WFSWriteGetFeatureOptions.prototype.filter; diff --git a/src/ol/format/filter/and.js b/src/ol/format/filter/and.js new file mode 100644 index 0000000000..7963ba59cd --- /dev/null +++ b/src/ol/format/filter/and.js @@ -0,0 +1,19 @@ +goog.provide('ol.format.filter.And'); + +goog.require('ol'); +goog.require('ol.format.filter.LogicalBinary'); + +/** + * @classdesc + * Represents a logical `` operator between two filter conditions. + * + * @constructor + * @param {!ol.format.filter.Filter} conditionA First filter condition. + * @param {!ol.format.filter.Filter} conditionB Second filter condition. + * @extends {ol.format.filter.LogicalBinary} + * @api + */ +ol.format.filter.And = function(conditionA, conditionB) { + ol.format.filter.LogicalBinary.call(this, 'And', conditionA, conditionB); +}; +ol.inherits(ol.format.filter.And, ol.format.filter.LogicalBinary); diff --git a/src/ol/format/ogc/filter/bbox.js b/src/ol/format/filter/bbox.js similarity index 66% rename from src/ol/format/ogc/filter/bbox.js rename to src/ol/format/filter/bbox.js index 5fae3c1610..adde43c1b4 100644 --- a/src/ol/format/ogc/filter/bbox.js +++ b/src/ol/format/filter/bbox.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.Bbox'); +goog.provide('ol.format.filter.Bbox'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Filter'); +goog.require('ol.format.filter.Filter'); /** @@ -14,12 +14,12 @@ goog.require('ol.format.ogc.filter.Filter'); * @param {!ol.Extent} extent Extent. * @param {string=} opt_srsName SRS name. No srsName attribute will be * set on geometries when this is not provided. - * @extends {ol.format.ogc.filter.Filter} + * @extends {ol.format.filter.Filter} * @api */ -ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) { +ol.format.filter.Bbox = function(geometryName, extent, opt_srsName) { - ol.format.ogc.filter.Filter.call(this, 'BBOX'); + ol.format.filter.Filter.call(this, 'BBOX'); /** * @public @@ -39,4 +39,4 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) { */ this.srsName = opt_srsName; }; -ol.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter); +ol.inherits(ol.format.filter.Bbox, ol.format.filter.Filter); diff --git a/src/ol/format/ogc/filter/comparison.js b/src/ol/format/filter/comparison.js similarity index 57% rename from src/ol/format/ogc/filter/comparison.js rename to src/ol/format/filter/comparison.js index 42f24da409..dc9a069a19 100644 --- a/src/ol/format/ogc/filter/comparison.js +++ b/src/ol/format/filter/comparison.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.Comparison'); +goog.provide('ol.format.filter.Comparison'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Filter'); +goog.require('ol.format.filter.Filter'); /** @@ -12,12 +12,12 @@ goog.require('ol.format.ogc.filter.Filter'); * @constructor * @param {!string} tagName The XML tag name for this filter. * @param {!string} propertyName Name of the context property to compare. - * @extends {ol.format.ogc.filter.Filter} + * @extends {ol.format.filter.Filter} * @api */ -ol.format.ogc.filter.Comparison = function(tagName, propertyName) { +ol.format.filter.Comparison = function(tagName, propertyName) { - ol.format.ogc.filter.Filter.call(this, tagName); + ol.format.filter.Filter.call(this, tagName); /** * @public @@ -25,4 +25,4 @@ ol.format.ogc.filter.Comparison = function(tagName, propertyName) { */ this.propertyName = propertyName; }; -ol.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter); +ol.inherits(ol.format.filter.Comparison, ol.format.filter.Filter); diff --git a/src/ol/format/ogc/filter/comparisonbinary.js b/src/ol/format/filter/comparisonbinary.js similarity index 67% rename from src/ol/format/ogc/filter/comparisonbinary.js rename to src/ol/format/filter/comparisonbinary.js index ffcc7cec33..45a3d815a9 100644 --- a/src/ol/format/ogc/filter/comparisonbinary.js +++ b/src/ol/format/filter/comparisonbinary.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.ComparisonBinary'); +goog.provide('ol.format.filter.ComparisonBinary'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Comparison'); +goog.require('ol.format.filter.Comparison'); /** @@ -14,13 +14,13 @@ goog.require('ol.format.ogc.filter.Comparison'); * @param {!string} propertyName Name of the context property to compare. * @param {!(string|number)} expression The value to compare. * @param {boolean=} opt_matchCase Case-sensitive? - * @extends {ol.format.ogc.filter.Comparison} + * @extends {ol.format.filter.Comparison} * @api */ -ol.format.ogc.filter.ComparisonBinary = function( +ol.format.filter.ComparisonBinary = function( tagName, propertyName, expression, opt_matchCase) { - ol.format.ogc.filter.Comparison.call(this, tagName, propertyName); + ol.format.filter.Comparison.call(this, tagName, propertyName); /** * @public @@ -34,4 +34,4 @@ ol.format.ogc.filter.ComparisonBinary = function( */ this.matchCase = opt_matchCase; }; -ol.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison); +ol.inherits(ol.format.filter.ComparisonBinary, ol.format.filter.Comparison); diff --git a/src/ol/format/filter/equalto.js b/src/ol/format/filter/equalto.js new file mode 100644 index 0000000000..5e1bc3dc02 --- /dev/null +++ b/src/ol/format/filter/equalto.js @@ -0,0 +1,21 @@ +goog.provide('ol.format.filter.EqualTo'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!(string|number)} expression The value to compare. + * @param {boolean=} opt_matchCase Case-sensitive? + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.EqualTo = function(propertyName, expression, opt_matchCase) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase); +}; +ol.inherits(ol.format.filter.EqualTo, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/filter.js b/src/ol/format/filter/filter.js similarity index 74% rename from src/ol/format/ogc/filter/filter.js rename to src/ol/format/filter/filter.js index 4d91067333..f3c456fc82 100644 --- a/src/ol/format/ogc/filter/filter.js +++ b/src/ol/format/filter/filter.js @@ -1,4 +1,4 @@ -goog.provide('ol.format.ogc.filter.Filter'); +goog.provide('ol.format.filter.Filter'); goog.require('ol'); @@ -13,7 +13,7 @@ goog.require('ol'); * @struct * @api */ -ol.format.ogc.filter.Filter = function(tagName) { +ol.format.filter.Filter = function(tagName) { /** * @private @@ -26,6 +26,6 @@ ol.format.ogc.filter.Filter = function(tagName) { * The XML tag name for a filter. * @returns {!string} Name. */ -ol.format.ogc.filter.Filter.prototype.getTagName = function() { +ol.format.filter.Filter.prototype.getTagName = function() { return this.tagName_; }; diff --git a/src/ol/format/filter/greaterthan.js b/src/ol/format/filter/greaterthan.js new file mode 100644 index 0000000000..c7306f5e4f --- /dev/null +++ b/src/ol/format/filter/greaterthan.js @@ -0,0 +1,20 @@ +goog.provide('ol.format.filter.GreaterThan'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.GreaterThan = function(propertyName, expression) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression); +}; +ol.inherits(ol.format.filter.GreaterThan, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/filter/greaterthanorequalto.js b/src/ol/format/filter/greaterthanorequalto.js new file mode 100644 index 0000000000..2105415ec2 --- /dev/null +++ b/src/ol/format/filter/greaterthanorequalto.js @@ -0,0 +1,20 @@ +goog.provide('ol.format.filter.GreaterThanOrEqualTo'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.GreaterThanOrEqualTo = function(propertyName, expression) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression); +}; +ol.inherits(ol.format.filter.GreaterThanOrEqualTo, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/filter/index.js b/src/ol/format/filter/index.js new file mode 100644 index 0000000000..bf48039838 --- /dev/null +++ b/src/ol/format/filter/index.js @@ -0,0 +1,233 @@ +goog.provide('ol.format.filter'); + +goog.require('ol'); +goog.require('ol.format.filter.And'); +goog.require('ol.format.filter.Bbox'); +goog.require('ol.format.filter.EqualTo'); +goog.require('ol.format.filter.GreaterThan'); +goog.require('ol.format.filter.GreaterThanOrEqualTo'); +goog.require('ol.format.filter.Intersects'); +goog.require('ol.format.filter.IsBetween'); +goog.require('ol.format.filter.IsLike'); +goog.require('ol.format.filter.IsNull'); +goog.require('ol.format.filter.LessThan'); +goog.require('ol.format.filter.LessThanOrEqualTo'); +goog.require('ol.format.filter.Not'); +goog.require('ol.format.filter.NotEqualTo'); +goog.require('ol.format.filter.Or'); +goog.require('ol.format.filter.Within'); + + +/** + * Create a logical `` operator between two filter conditions. + * + * @param {!ol.format.filter.Filter} conditionA First filter condition. + * @param {!ol.format.filter.Filter} conditionB Second filter condition. + * @returns {!ol.format.filter.And} `` operator. + * @api + */ +ol.format.filter.and = function(conditionA, conditionB) { + return new ol.format.filter.And(conditionA, conditionB); +}; + + +/** + * Create a logical `` operator between two filter conditions. + * + * @param {!ol.format.filter.Filter} conditionA First filter condition. + * @param {!ol.format.filter.Filter} conditionB Second filter condition. + * @returns {!ol.format.filter.Or} `` operator. + * @api + */ +ol.format.filter.or = function(conditionA, conditionB) { + return new ol.format.filter.Or(conditionA, conditionB); +}; + + +/** + * Represents a logical `` operator for a filter condition. + * + * @param {!ol.format.filter.Filter} condition Filter condition. + * @returns {!ol.format.filter.Not} `` operator. + * @api + */ +ol.format.filter.not = function(condition) { + return new ol.format.filter.Not(condition); +}; + + +/** + * Create a `` operator to test whether a geometry-valued property + * intersects a fixed bounding box + * + * @param {!string} geometryName Geometry name to use. + * @param {!ol.Extent} extent Extent. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @returns {!ol.format.filter.Bbox} `` operator. + * @api + */ +ol.format.filter.bbox = function(geometryName, extent, opt_srsName) { + return new ol.format.filter.Bbox(geometryName, extent, opt_srsName); +}; + +/** + * Create a `` operator to test whether a geometry-valued property + * intersects a given geometry. + * + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @returns {!ol.format.filter.Intersects} `` operator. + * @api + */ +ol.format.filter.intersects = function(geometryName, geometry, opt_srsName) { + return new ol.format.filter.Intersects(geometryName, geometry, opt_srsName); +}; + +/** + * Create a `` operator to test whether a geometry-valued property + * is within a given geometry. + * + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @returns {!ol.format.filter.Within} `` operator. + * @api + */ +ol.format.filter.within = function(geometryName, geometry, opt_srsName) { + return new ol.format.filter.Within(geometryName, geometry, opt_srsName); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!(string|number)} expression The value to compare. + * @param {boolean=} opt_matchCase Case-sensitive? + * @returns {!ol.format.filter.EqualTo} `` operator. + * @api + */ +ol.format.filter.equalTo = function(propertyName, expression, opt_matchCase) { + return new ol.format.filter.EqualTo(propertyName, expression, opt_matchCase); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!(string|number)} expression The value to compare. + * @param {boolean=} opt_matchCase Case-sensitive? + * @returns {!ol.format.filter.NotEqualTo} `` operator. + * @api + */ +ol.format.filter.notEqualTo = function(propertyName, expression, opt_matchCase) { + return new ol.format.filter.NotEqualTo(propertyName, expression, opt_matchCase); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @returns {!ol.format.filter.LessThan} `` operator. + * @api + */ +ol.format.filter.lessThan = function(propertyName, expression) { + return new ol.format.filter.LessThan(propertyName, expression); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @returns {!ol.format.filter.LessThanOrEqualTo} `` operator. + * @api + */ +ol.format.filter.lessThanOrEqualTo = function(propertyName, expression) { + return new ol.format.filter.LessThanOrEqualTo(propertyName, expression); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @returns {!ol.format.filter.GreaterThan} `` operator. + * @api + */ +ol.format.filter.greaterThan = function(propertyName, expression) { + return new ol.format.filter.GreaterThan(propertyName, expression); +}; + + +/** + * Creates a `` comparison operator. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @returns {!ol.format.filter.GreaterThanOrEqualTo} `` operator. + * @api + */ +ol.format.filter.greaterThanOrEqualTo = function(propertyName, expression) { + return new ol.format.filter.GreaterThanOrEqualTo(propertyName, expression); +}; + + +/** + * Creates a `` comparison operator to test whether a property value + * is null. + * + * @param {!string} propertyName Name of the context property to compare. + * @returns {!ol.format.filter.IsNull} `` operator. + * @api + */ +ol.format.filter.isNull = function(propertyName) { + return new ol.format.filter.IsNull(propertyName); +}; + + +/** + * Creates a `` comparison operator to test whether an expression + * value lies within a range given by a lower and upper bound (inclusive). + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} lowerBoundary The lower bound of the range. + * @param {!number} upperBoundary The upper bound of the range. + * @returns {!ol.format.filter.IsBetween} `` operator. + * @api + */ +ol.format.filter.between = function(propertyName, lowerBoundary, upperBoundary) { + return new ol.format.filter.IsBetween(propertyName, lowerBoundary, upperBoundary); +}; + + +/** + * Represents a `` comparison operator that matches a string property + * value against a text pattern. + * + * @param {!string} propertyName Name of the context property to compare. + * @param {!string} pattern Text pattern. + * @param {string=} opt_wildCard Pattern character which matches any sequence of + * zero or more string characters. Default is '*'. + * @param {string=} opt_singleChar pattern character which matches any single + * string character. Default is '.'. + * @param {string=} opt_escapeChar Escape character which can be used to escape + * the pattern characters. Default is '!'. + * @param {boolean=} opt_matchCase Case-sensitive? + * @returns {!ol.format.filter.IsLike} `` operator. + * @api + */ +ol.format.filter.like = function(propertyName, pattern, + opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { + return new ol.format.filter.IsLike(propertyName, pattern, + opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase); +}; diff --git a/src/ol/format/ogc/filter/index.jsdoc b/src/ol/format/filter/index.jsdoc similarity index 86% rename from src/ol/format/ogc/filter/index.jsdoc rename to src/ol/format/filter/index.jsdoc index a411e958cc..dcd136cd62 100644 --- a/src/ol/format/ogc/filter/index.jsdoc +++ b/src/ol/format/filter/index.jsdoc @@ -9,12 +9,12 @@ * featureNS: 'http://www.openplans.org/topp', * featurePrefix: 'topp', * featureTypes: ['states'], - * filter: ol.format.ogc.filter.equalTo('name', 'New York') + * filter: ol.format.filter.equalTo('name', 'New York') * }); * * Or to combine a `BBOX` filter with a `PropertyIsLike` filter: * - * var f = ol.format.ogc.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', @@ -25,5 +25,5 @@ * f.like('name', 'New*') * ) * }); - * @namespace ol.format.ogc.filter + * @namespace ol.format.filter */ diff --git a/src/ol/format/ogc/filter/intersects.js b/src/ol/format/filter/intersects.js similarity index 51% rename from src/ol/format/ogc/filter/intersects.js rename to src/ol/format/filter/intersects.js index 3a0b91c230..774868b1b2 100644 --- a/src/ol/format/ogc/filter/intersects.js +++ b/src/ol/format/filter/intersects.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.Intersects'); +goog.provide('ol.format.filter.Intersects'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Spatial'); +goog.require('ol.format.filter.Spatial'); /** @@ -14,12 +14,12 @@ goog.require('ol.format.ogc.filter.Spatial'); * @param {!ol.geom.Geometry} geometry Geometry. * @param {string=} opt_srsName SRS name. No srsName attribute will be * set on geometries when this is not provided. - * @extends {ol.format.ogc.filter.Spatial} + * @extends {ol.format.filter.Spatial} * @api */ -ol.format.ogc.filter.Intersects = function(geometryName, geometry, opt_srsName) { +ol.format.filter.Intersects = function(geometryName, geometry, opt_srsName) { - ol.format.ogc.filter.Spatial.call(this, 'Intersects', geometryName, geometry, opt_srsName); + ol.format.filter.Spatial.call(this, 'Intersects', geometryName, geometry, opt_srsName); }; -ol.inherits(ol.format.ogc.filter.Intersects, ol.format.ogc.filter.Spatial); +ol.inherits(ol.format.filter.Intersects, ol.format.filter.Spatial); diff --git a/src/ol/format/ogc/filter/isbetween.js b/src/ol/format/filter/isbetween.js similarity index 56% rename from src/ol/format/ogc/filter/isbetween.js rename to src/ol/format/filter/isbetween.js index bf49ca85b1..2421a1d003 100644 --- a/src/ol/format/ogc/filter/isbetween.js +++ b/src/ol/format/filter/isbetween.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.IsBetween'); +goog.provide('ol.format.filter.IsBetween'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Comparison'); +goog.require('ol.format.filter.Comparison'); /** @@ -12,11 +12,11 @@ goog.require('ol.format.ogc.filter.Comparison'); * @param {!string} propertyName Name of the context property to compare. * @param {!number} lowerBoundary The lower bound of the range. * @param {!number} upperBoundary The upper bound of the range. - * @extends {ol.format.ogc.filter.Comparison} + * @extends {ol.format.filter.Comparison} * @api */ -ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoundary) { - ol.format.ogc.filter.Comparison.call(this, 'PropertyIsBetween', propertyName); +ol.format.filter.IsBetween = function(propertyName, lowerBoundary, upperBoundary) { + ol.format.filter.Comparison.call(this, 'PropertyIsBetween', propertyName); /** * @public @@ -30,4 +30,4 @@ ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoun */ this.upperBoundary = upperBoundary; }; -ol.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison); +ol.inherits(ol.format.filter.IsBetween, ol.format.filter.Comparison); diff --git a/src/ol/format/ogc/filter/islike.js b/src/ol/format/filter/islike.js similarity index 78% rename from src/ol/format/ogc/filter/islike.js rename to src/ol/format/filter/islike.js index f136a8b064..7b64050520 100644 --- a/src/ol/format/ogc/filter/islike.js +++ b/src/ol/format/filter/islike.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.IsLike'); +goog.provide('ol.format.filter.IsLike'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Comparison'); +goog.require('ol.format.filter.Comparison'); /** @@ -18,12 +18,12 @@ goog.require('ol.format.ogc.filter.Comparison'); * @param {string=} opt_escapeChar Escape character which can be used to escape * the pattern characters. Default is '!'. * @param {boolean=} opt_matchCase Case-sensitive? - * @extends {ol.format.ogc.filter.Comparison} + * @extends {ol.format.filter.Comparison} * @api */ -ol.format.ogc.filter.IsLike = function(propertyName, pattern, +ol.format.filter.IsLike = function(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { - ol.format.ogc.filter.Comparison.call(this, 'PropertyIsLike', propertyName); + ol.format.filter.Comparison.call(this, 'PropertyIsLike', propertyName); /** * @public @@ -55,4 +55,4 @@ ol.format.ogc.filter.IsLike = function(propertyName, pattern, */ this.matchCase = opt_matchCase; }; -ol.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison); +ol.inherits(ol.format.filter.IsLike, ol.format.filter.Comparison); diff --git a/src/ol/format/filter/isnull.js b/src/ol/format/filter/isnull.js new file mode 100644 index 0000000000..42ac132d86 --- /dev/null +++ b/src/ol/format/filter/isnull.js @@ -0,0 +1,19 @@ +goog.provide('ol.format.filter.IsNull'); + +goog.require('ol'); +goog.require('ol.format.filter.Comparison'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @extends {ol.format.filter.Comparison} + * @api + */ +ol.format.filter.IsNull = function(propertyName) { + ol.format.filter.Comparison.call(this, 'PropertyIsNull', propertyName); +}; +ol.inherits(ol.format.filter.IsNull, ol.format.filter.Comparison); diff --git a/src/ol/format/filter/lessthan.js b/src/ol/format/filter/lessthan.js new file mode 100644 index 0000000000..8d02359674 --- /dev/null +++ b/src/ol/format/filter/lessthan.js @@ -0,0 +1,20 @@ +goog.provide('ol.format.filter.LessThan'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.LessThan = function(propertyName, expression) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression); +}; +ol.inherits(ol.format.filter.LessThan, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/filter/lessthanorequalto.js b/src/ol/format/filter/lessthanorequalto.js new file mode 100644 index 0000000000..24fce9c499 --- /dev/null +++ b/src/ol/format/filter/lessthanorequalto.js @@ -0,0 +1,20 @@ +goog.provide('ol.format.filter.LessThanOrEqualTo'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!number} expression The value to compare. + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.LessThanOrEqualTo = function(propertyName, expression) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression); +}; +ol.inherits(ol.format.filter.LessThanOrEqualTo, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/filter/logical.js b/src/ol/format/filter/logical.js new file mode 100644 index 0000000000..bec00ce144 --- /dev/null +++ b/src/ol/format/filter/logical.js @@ -0,0 +1,19 @@ +goog.provide('ol.format.filter.Logical'); + +goog.require('ol'); +goog.require('ol.format.filter.Filter'); + + +/** + * @classdesc + * Abstract class; normally only used for creating subclasses and not instantiated in apps. + * Base class for WFS GetFeature logical filters. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @extends {ol.format.filter.Filter} + */ +ol.format.filter.Logical = function(tagName) { + ol.format.filter.Filter.call(this, tagName); +}; +ol.inherits(ol.format.filter.Logical, ol.format.filter.Filter); diff --git a/src/ol/format/filter/logicalbinary.js b/src/ol/format/filter/logicalbinary.js new file mode 100644 index 0000000000..9596e2b423 --- /dev/null +++ b/src/ol/format/filter/logicalbinary.js @@ -0,0 +1,35 @@ +goog.provide('ol.format.filter.LogicalBinary'); + +goog.require('ol'); +goog.require('ol.format.filter.Logical'); + + +/** + * @classdesc + * Abstract class; normally only used for creating subclasses and not instantiated in apps. + * Base class for WFS GetFeature binary logical filters. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @param {!ol.format.filter.Filter} conditionA First filter condition. + * @param {!ol.format.filter.Filter} conditionB Second filter condition. + * @extends {ol.format.filter.Logical} + */ +ol.format.filter.LogicalBinary = function(tagName, conditionA, conditionB) { + + ol.format.filter.Logical.call(this, tagName); + + /** + * @public + * @type {!ol.format.filter.Filter} + */ + this.conditionA = conditionA; + + /** + * @public + * @type {!ol.format.filter.Filter} + */ + this.conditionB = conditionB; + +}; +ol.inherits(ol.format.filter.LogicalBinary, ol.format.filter.Logical); diff --git a/src/ol/format/filter/not.js b/src/ol/format/filter/not.js new file mode 100644 index 0000000000..98cd6f49c0 --- /dev/null +++ b/src/ol/format/filter/not.js @@ -0,0 +1,26 @@ +goog.provide('ol.format.filter.Not'); + +goog.require('ol'); +goog.require('ol.format.filter.Logical'); + + +/** + * @classdesc + * Represents a logical `` operator for a filter condition. + * + * @constructor + * @param {!ol.format.filter.Filter} condition Filter condition. + * @extends {ol.format.filter.Logical} + * @api + */ +ol.format.filter.Not = function(condition) { + + ol.format.filter.Logical.call(this, 'Not'); + + /** + * @public + * @type {!ol.format.filter.Filter} + */ + this.condition = condition; +}; +ol.inherits(ol.format.filter.Not, ol.format.filter.Logical); diff --git a/src/ol/format/filter/notequalto.js b/src/ol/format/filter/notequalto.js new file mode 100644 index 0000000000..a281326257 --- /dev/null +++ b/src/ol/format/filter/notequalto.js @@ -0,0 +1,21 @@ +goog.provide('ol.format.filter.NotEqualTo'); + +goog.require('ol'); +goog.require('ol.format.filter.ComparisonBinary'); + + +/** + * @classdesc + * Represents a `` comparison operator. + * + * @constructor + * @param {!string} propertyName Name of the context property to compare. + * @param {!(string|number)} expression The value to compare. + * @param {boolean=} opt_matchCase Case-sensitive? + * @extends {ol.format.filter.ComparisonBinary} + * @api + */ +ol.format.filter.NotEqualTo = function(propertyName, expression, opt_matchCase) { + ol.format.filter.ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase); +}; +ol.inherits(ol.format.filter.NotEqualTo, ol.format.filter.ComparisonBinary); diff --git a/src/ol/format/filter/or.js b/src/ol/format/filter/or.js new file mode 100644 index 0000000000..919a2f39db --- /dev/null +++ b/src/ol/format/filter/or.js @@ -0,0 +1,20 @@ +goog.provide('ol.format.filter.Or'); + +goog.require('ol'); +goog.require('ol.format.filter.LogicalBinary'); + + +/** + * @classdesc + * Represents a logical `` operator between two filter conditions. + * + * @constructor + * @param {!ol.format.filter.Filter} conditionA First filter condition. + * @param {!ol.format.filter.Filter} conditionB Second filter condition. + * @extends {ol.format.filter.LogicalBinary} + * @api + */ +ol.format.filter.Or = function(conditionA, conditionB) { + ol.format.filter.LogicalBinary.call(this, 'Or', conditionA, conditionB); +}; +ol.inherits(ol.format.filter.Or, ol.format.filter.LogicalBinary); diff --git a/src/ol/format/ogc/filter/spatial.js b/src/ol/format/filter/spatial.js similarity index 68% rename from src/ol/format/ogc/filter/spatial.js rename to src/ol/format/filter/spatial.js index 645bd74c08..e00fd95423 100644 --- a/src/ol/format/ogc/filter/spatial.js +++ b/src/ol/format/filter/spatial.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.Spatial'); +goog.provide('ol.format.filter.Spatial'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Filter'); +goog.require('ol.format.filter.Filter'); /** @@ -15,12 +15,12 @@ goog.require('ol.format.ogc.filter.Filter'); * @param {!ol.geom.Geometry} geometry Geometry. * @param {string=} opt_srsName SRS name. No srsName attribute will be * set on geometries when this is not provided. - * @extends {ol.format.ogc.filter.Filter} + * @extends {ol.format.filter.Filter} * @api */ -ol.format.ogc.filter.Spatial = function(tagName, geometryName, geometry, opt_srsName) { +ol.format.filter.Spatial = function(tagName, geometryName, geometry, opt_srsName) { - ol.format.ogc.filter.Filter.call(this, tagName); + ol.format.filter.Filter.call(this, tagName); /** * @public @@ -40,4 +40,4 @@ ol.format.ogc.filter.Spatial = function(tagName, geometryName, geometry, opt_srs */ this.srsName = opt_srsName; }; -ol.inherits(ol.format.ogc.filter.Spatial, ol.format.ogc.filter.Filter); +ol.inherits(ol.format.filter.Spatial, ol.format.filter.Filter); diff --git a/src/ol/format/ogc/filter/within.js b/src/ol/format/filter/within.js similarity index 52% rename from src/ol/format/ogc/filter/within.js rename to src/ol/format/filter/within.js index 4280ca4219..aa698ec5ff 100644 --- a/src/ol/format/ogc/filter/within.js +++ b/src/ol/format/filter/within.js @@ -1,7 +1,7 @@ -goog.provide('ol.format.ogc.filter.Within'); +goog.provide('ol.format.filter.Within'); goog.require('ol'); -goog.require('ol.format.ogc.filter.Spatial'); +goog.require('ol.format.filter.Spatial'); /** @@ -14,12 +14,12 @@ goog.require('ol.format.ogc.filter.Spatial'); * @param {!ol.geom.Geometry} geometry Geometry. * @param {string=} opt_srsName SRS name. No srsName attribute will be * set on geometries when this is not provided. - * @extends {ol.format.ogc.filter.Spatial} + * @extends {ol.format.filter.Spatial} * @api */ -ol.format.ogc.filter.Within = function(geometryName, geometry, opt_srsName) { +ol.format.filter.Within = function(geometryName, geometry, opt_srsName) { - ol.format.ogc.filter.Spatial.call(this, 'Within', geometryName, geometry, opt_srsName); + ol.format.filter.Spatial.call(this, 'Within', geometryName, geometry, opt_srsName); }; -ol.inherits(ol.format.ogc.filter.Within, ol.format.ogc.filter.Spatial); +ol.inherits(ol.format.filter.Within, ol.format.filter.Spatial); diff --git a/src/ol/format/ogc/filter/and.js b/src/ol/format/ogc/filter/and.js deleted file mode 100644 index c45b0a0066..0000000000 --- a/src/ol/format/ogc/filter/and.js +++ /dev/null @@ -1,19 +0,0 @@ -goog.provide('ol.format.ogc.filter.And'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.LogicalBinary'); - -/** - * @classdesc - * Represents a logical `` operator between two filter conditions. - * - * @constructor - * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. - * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. - * @extends {ol.format.ogc.filter.LogicalBinary} - * @api - */ -ol.format.ogc.filter.And = function(conditionA, conditionB) { - ol.format.ogc.filter.LogicalBinary.call(this, 'And', conditionA, conditionB); -}; -ol.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary); diff --git a/src/ol/format/ogc/filter/equalto.js b/src/ol/format/ogc/filter/equalto.js deleted file mode 100644 index 7cc78dd2c7..0000000000 --- a/src/ol/format/ogc/filter/equalto.js +++ /dev/null @@ -1,21 +0,0 @@ -goog.provide('ol.format.ogc.filter.EqualTo'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!(string|number)} expression The value to compare. - * @param {boolean=} opt_matchCase Case-sensitive? - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.EqualTo = function(propertyName, expression, opt_matchCase) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase); -}; -ol.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/greaterthan.js b/src/ol/format/ogc/filter/greaterthan.js deleted file mode 100644 index bf6ec9bcb8..0000000000 --- a/src/ol/format/ogc/filter/greaterthan.js +++ /dev/null @@ -1,20 +0,0 @@ -goog.provide('ol.format.ogc.filter.GreaterThan'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.GreaterThan = function(propertyName, expression) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression); -}; -ol.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/greaterthanorequalto.js b/src/ol/format/ogc/filter/greaterthanorequalto.js deleted file mode 100644 index 7b2cf12bda..0000000000 --- a/src/ol/format/ogc/filter/greaterthanorequalto.js +++ /dev/null @@ -1,20 +0,0 @@ -goog.provide('ol.format.ogc.filter.GreaterThanOrEqualTo'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.GreaterThanOrEqualTo = function(propertyName, expression) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression); -}; -ol.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/index.js b/src/ol/format/ogc/filter/index.js deleted file mode 100644 index 7878652524..0000000000 --- a/src/ol/format/ogc/filter/index.js +++ /dev/null @@ -1,233 +0,0 @@ -goog.provide('ol.format.ogc.filter'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.And'); -goog.require('ol.format.ogc.filter.Bbox'); -goog.require('ol.format.ogc.filter.EqualTo'); -goog.require('ol.format.ogc.filter.GreaterThan'); -goog.require('ol.format.ogc.filter.GreaterThanOrEqualTo'); -goog.require('ol.format.ogc.filter.Intersects'); -goog.require('ol.format.ogc.filter.IsBetween'); -goog.require('ol.format.ogc.filter.IsLike'); -goog.require('ol.format.ogc.filter.IsNull'); -goog.require('ol.format.ogc.filter.LessThan'); -goog.require('ol.format.ogc.filter.LessThanOrEqualTo'); -goog.require('ol.format.ogc.filter.Not'); -goog.require('ol.format.ogc.filter.NotEqualTo'); -goog.require('ol.format.ogc.filter.Or'); -goog.require('ol.format.ogc.filter.Within'); - - -/** - * Create a logical `` operator between two filter conditions. - * - * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. - * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. - * @returns {!ol.format.ogc.filter.And} `` operator. - * @api - */ -ol.format.ogc.filter.and = function(conditionA, conditionB) { - return new ol.format.ogc.filter.And(conditionA, conditionB); -}; - - -/** - * Create a logical `` operator between two filter conditions. - * - * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. - * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. - * @returns {!ol.format.ogc.filter.Or} `` operator. - * @api - */ -ol.format.ogc.filter.or = function(conditionA, conditionB) { - return new ol.format.ogc.filter.Or(conditionA, conditionB); -}; - - -/** - * Represents a logical `` operator for a filter condition. - * - * @param {!ol.format.ogc.filter.Filter} condition Filter condition. - * @returns {!ol.format.ogc.filter.Not} `` operator. - * @api - */ -ol.format.ogc.filter.not = function(condition) { - return new ol.format.ogc.filter.Not(condition); -}; - - -/** - * Create a `` operator to test whether a geometry-valued property - * intersects a fixed bounding box - * - * @param {!string} geometryName Geometry name to use. - * @param {!ol.Extent} extent Extent. - * @param {string=} opt_srsName SRS name. No srsName attribute will be - * set on geometries when this is not provided. - * @returns {!ol.format.ogc.filter.Bbox} `` operator. - * @api - */ -ol.format.ogc.filter.bbox = function(geometryName, extent, opt_srsName) { - return new ol.format.ogc.filter.Bbox(geometryName, extent, opt_srsName); -}; - -/** - * Create a `` operator to test whether a geometry-valued property - * intersects a given geometry. - * - * @param {!string} geometryName Geometry name to use. - * @param {!ol.geom.Geometry} geometry Geometry. - * @param {string=} opt_srsName SRS name. No srsName attribute will be - * set on geometries when this is not provided. - * @returns {!ol.format.ogc.filter.Intersects} `` operator. - * @api - */ -ol.format.ogc.filter.intersects = function(geometryName, geometry, opt_srsName) { - return new ol.format.ogc.filter.Intersects(geometryName, geometry, opt_srsName); -}; - -/** - * Create a `` operator to test whether a geometry-valued property - * is within a given geometry. - * - * @param {!string} geometryName Geometry name to use. - * @param {!ol.geom.Geometry} geometry Geometry. - * @param {string=} opt_srsName SRS name. No srsName attribute will be - * set on geometries when this is not provided. - * @returns {!ol.format.ogc.filter.Within} `` operator. - * @api - */ -ol.format.ogc.filter.within = function(geometryName, geometry, opt_srsName) { - return new ol.format.ogc.filter.Within(geometryName, geometry, opt_srsName); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!(string|number)} expression The value to compare. - * @param {boolean=} opt_matchCase Case-sensitive? - * @returns {!ol.format.ogc.filter.EqualTo} `` operator. - * @api - */ -ol.format.ogc.filter.equalTo = function(propertyName, expression, opt_matchCase) { - return new ol.format.ogc.filter.EqualTo(propertyName, expression, opt_matchCase); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!(string|number)} expression The value to compare. - * @param {boolean=} opt_matchCase Case-sensitive? - * @returns {!ol.format.ogc.filter.NotEqualTo} `` operator. - * @api - */ -ol.format.ogc.filter.notEqualTo = function(propertyName, expression, opt_matchCase) { - return new ol.format.ogc.filter.NotEqualTo(propertyName, expression, opt_matchCase); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @returns {!ol.format.ogc.filter.LessThan} `` operator. - * @api - */ -ol.format.ogc.filter.lessThan = function(propertyName, expression) { - return new ol.format.ogc.filter.LessThan(propertyName, expression); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @returns {!ol.format.ogc.filter.LessThanOrEqualTo} `` operator. - * @api - */ -ol.format.ogc.filter.lessThanOrEqualTo = function(propertyName, expression) { - return new ol.format.ogc.filter.LessThanOrEqualTo(propertyName, expression); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @returns {!ol.format.ogc.filter.GreaterThan} `` operator. - * @api - */ -ol.format.ogc.filter.greaterThan = function(propertyName, expression) { - return new ol.format.ogc.filter.GreaterThan(propertyName, expression); -}; - - -/** - * Creates a `` comparison operator. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @returns {!ol.format.ogc.filter.GreaterThanOrEqualTo} `` operator. - * @api - */ -ol.format.ogc.filter.greaterThanOrEqualTo = function(propertyName, expression) { - return new ol.format.ogc.filter.GreaterThanOrEqualTo(propertyName, expression); -}; - - -/** - * Creates a `` comparison operator to test whether a property value - * is null. - * - * @param {!string} propertyName Name of the context property to compare. - * @returns {!ol.format.ogc.filter.IsNull} `` operator. - * @api - */ -ol.format.ogc.filter.isNull = function(propertyName) { - return new ol.format.ogc.filter.IsNull(propertyName); -}; - - -/** - * Creates a `` comparison operator to test whether an expression - * value lies within a range given by a lower and upper bound (inclusive). - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} lowerBoundary The lower bound of the range. - * @param {!number} upperBoundary The upper bound of the range. - * @returns {!ol.format.ogc.filter.IsBetween} `` operator. - * @api - */ -ol.format.ogc.filter.between = function(propertyName, lowerBoundary, upperBoundary) { - return new ol.format.ogc.filter.IsBetween(propertyName, lowerBoundary, upperBoundary); -}; - - -/** - * Represents a `` comparison operator that matches a string property - * value against a text pattern. - * - * @param {!string} propertyName Name of the context property to compare. - * @param {!string} pattern Text pattern. - * @param {string=} opt_wildCard Pattern character which matches any sequence of - * zero or more string characters. Default is '*'. - * @param {string=} opt_singleChar pattern character which matches any single - * string character. Default is '.'. - * @param {string=} opt_escapeChar Escape character which can be used to escape - * the pattern characters. Default is '!'. - * @param {boolean=} opt_matchCase Case-sensitive? - * @returns {!ol.format.ogc.filter.IsLike} `` operator. - * @api - */ -ol.format.ogc.filter.like = function(propertyName, pattern, - opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { - return new ol.format.ogc.filter.IsLike(propertyName, pattern, - opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase); -}; diff --git a/src/ol/format/ogc/filter/isnull.js b/src/ol/format/ogc/filter/isnull.js deleted file mode 100644 index 9d48fb03a5..0000000000 --- a/src/ol/format/ogc/filter/isnull.js +++ /dev/null @@ -1,19 +0,0 @@ -goog.provide('ol.format.ogc.filter.IsNull'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.Comparison'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @extends {ol.format.ogc.filter.Comparison} - * @api - */ -ol.format.ogc.filter.IsNull = function(propertyName) { - ol.format.ogc.filter.Comparison.call(this, 'PropertyIsNull', propertyName); -}; -ol.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison); diff --git a/src/ol/format/ogc/filter/lessthan.js b/src/ol/format/ogc/filter/lessthan.js deleted file mode 100644 index 0d233aa8d2..0000000000 --- a/src/ol/format/ogc/filter/lessthan.js +++ /dev/null @@ -1,20 +0,0 @@ -goog.provide('ol.format.ogc.filter.LessThan'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.LessThan = function(propertyName, expression) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression); -}; -ol.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/lessthanorequalto.js b/src/ol/format/ogc/filter/lessthanorequalto.js deleted file mode 100644 index dd618e242c..0000000000 --- a/src/ol/format/ogc/filter/lessthanorequalto.js +++ /dev/null @@ -1,20 +0,0 @@ -goog.provide('ol.format.ogc.filter.LessThanOrEqualTo'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!number} expression The value to compare. - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.LessThanOrEqualTo = function(propertyName, expression) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression); -}; -ol.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/logical.js b/src/ol/format/ogc/filter/logical.js deleted file mode 100644 index 9a346ac059..0000000000 --- a/src/ol/format/ogc/filter/logical.js +++ /dev/null @@ -1,19 +0,0 @@ -goog.provide('ol.format.ogc.filter.Logical'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.Filter'); - - -/** - * @classdesc - * Abstract class; normally only used for creating subclasses and not instantiated in apps. - * Base class for WFS GetFeature logical filters. - * - * @constructor - * @param {!string} tagName The XML tag name for this filter. - * @extends {ol.format.ogc.filter.Filter} - */ -ol.format.ogc.filter.Logical = function(tagName) { - ol.format.ogc.filter.Filter.call(this, tagName); -}; -ol.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter); diff --git a/src/ol/format/ogc/filter/logicalbinary.js b/src/ol/format/ogc/filter/logicalbinary.js deleted file mode 100644 index 06eae237c5..0000000000 --- a/src/ol/format/ogc/filter/logicalbinary.js +++ /dev/null @@ -1,35 +0,0 @@ -goog.provide('ol.format.ogc.filter.LogicalBinary'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.Logical'); - - -/** - * @classdesc - * Abstract class; normally only used for creating subclasses and not instantiated in apps. - * Base class for WFS GetFeature binary logical filters. - * - * @constructor - * @param {!string} tagName The XML tag name for this filter. - * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. - * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. - * @extends {ol.format.ogc.filter.Logical} - */ -ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) { - - ol.format.ogc.filter.Logical.call(this, tagName); - - /** - * @public - * @type {!ol.format.ogc.filter.Filter} - */ - this.conditionA = conditionA; - - /** - * @public - * @type {!ol.format.ogc.filter.Filter} - */ - this.conditionB = conditionB; - -}; -ol.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical); diff --git a/src/ol/format/ogc/filter/not.js b/src/ol/format/ogc/filter/not.js deleted file mode 100644 index 2e23622080..0000000000 --- a/src/ol/format/ogc/filter/not.js +++ /dev/null @@ -1,26 +0,0 @@ -goog.provide('ol.format.ogc.filter.Not'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.Logical'); - - -/** - * @classdesc - * Represents a logical `` operator for a filter condition. - * - * @constructor - * @param {!ol.format.ogc.filter.Filter} condition Filter condition. - * @extends {ol.format.ogc.filter.Logical} - * @api - */ -ol.format.ogc.filter.Not = function(condition) { - - ol.format.ogc.filter.Logical.call(this, 'Not'); - - /** - * @public - * @type {!ol.format.ogc.filter.Filter} - */ - this.condition = condition; -}; -ol.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical); diff --git a/src/ol/format/ogc/filter/notequalto.js b/src/ol/format/ogc/filter/notequalto.js deleted file mode 100644 index fb56616f4f..0000000000 --- a/src/ol/format/ogc/filter/notequalto.js +++ /dev/null @@ -1,21 +0,0 @@ -goog.provide('ol.format.ogc.filter.NotEqualTo'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.ComparisonBinary'); - - -/** - * @classdesc - * Represents a `` comparison operator. - * - * @constructor - * @param {!string} propertyName Name of the context property to compare. - * @param {!(string|number)} expression The value to compare. - * @param {boolean=} opt_matchCase Case-sensitive? - * @extends {ol.format.ogc.filter.ComparisonBinary} - * @api - */ -ol.format.ogc.filter.NotEqualTo = function(propertyName, expression, opt_matchCase) { - ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase); -}; -ol.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary); diff --git a/src/ol/format/ogc/filter/or.js b/src/ol/format/ogc/filter/or.js deleted file mode 100644 index c38778581c..0000000000 --- a/src/ol/format/ogc/filter/or.js +++ /dev/null @@ -1,20 +0,0 @@ -goog.provide('ol.format.ogc.filter.Or'); - -goog.require('ol'); -goog.require('ol.format.ogc.filter.LogicalBinary'); - - -/** - * @classdesc - * Represents a logical `` operator between two filter conditions. - * - * @constructor - * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. - * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. - * @extends {ol.format.ogc.filter.LogicalBinary} - * @api - */ -ol.format.ogc.filter.Or = function(conditionA, conditionB) { - ol.format.ogc.filter.LogicalBinary.call(this, 'Or', conditionA, conditionB); -}; -ol.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary); diff --git a/src/ol/format/wfs.js b/src/ol/format/wfs.js index 45f6aa57a4..8cf9e825ba 100644 --- a/src/ol/format/wfs.js +++ b/src/ol/format/wfs.js @@ -4,7 +4,7 @@ goog.require('ol'); goog.require('ol.asserts'); goog.require('ol.format.GML3'); goog.require('ol.format.GMLBase'); -goog.require('ol.format.ogc.filter'); +goog.require('ol.format.filter'); goog.require('ol.format.XMLFeature'); goog.require('ol.format.XSD'); goog.require('ol.geom.Geometry'); @@ -550,7 +550,7 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.Filter} filter Filter. + * @param {ol.format.filter.Filter} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -566,7 +566,7 @@ ol.format.WFS.writeFilterCondition_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.Bbox} filter Filter. + * @param {ol.format.filter.Bbox} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -581,7 +581,7 @@ ol.format.WFS.writeBboxFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.Intersects} filter Filter. + * @param {ol.format.filter.Intersects} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -596,7 +596,7 @@ ol.format.WFS.writeIntersectsFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.Within} filter Filter. + * @param {ol.format.filter.Within} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -611,7 +611,7 @@ ol.format.WFS.writeWithinFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.LogicalBinary} filter Filter. + * @param {ol.format.filter.LogicalBinary} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -633,7 +633,7 @@ ol.format.WFS.writeLogicalFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.Not} filter Filter. + * @param {ol.format.filter.Not} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -650,7 +650,7 @@ ol.format.WFS.writeNotFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.ComparisonBinary} filter Filter. + * @param {ol.format.filter.ComparisonBinary} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -665,7 +665,7 @@ ol.format.WFS.writeComparisonFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.IsNull} filter Filter. + * @param {ol.format.filter.IsNull} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -676,7 +676,7 @@ ol.format.WFS.writeIsNullFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.IsBetween} filter Filter. + * @param {ol.format.filter.IsBetween} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -695,7 +695,7 @@ ol.format.WFS.writeIsBetweenFilter_ = function(node, filter, objectStack) { /** * @param {Node} node Node. - * @param {ol.format.ogc.filter.IsLike} filter Filter. + * @param {ol.format.filter.IsLike} filter Filter. * @param {Array.<*>} objectStack Node stack. * @private */ @@ -824,11 +824,11 @@ ol.format.WFS.prototype.writeGetFeature = function(options) { if (options.bbox) { ol.asserts.assert(options.geometryName, 12); // `options.geometryName` must also be provided when `options.bbox` is set - var bbox = ol.format.ogc.filter.bbox( + var bbox = ol.format.filter.bbox( /** @type {string} */ (options.geometryName), options.bbox, options.srsName); if (filter) { // if bbox and filter are both set, combine the two into a single filter - filter = ol.format.ogc.filter.and(filter, bbox); + filter = ol.format.filter.and(filter, bbox); } else { filter = bbox; } diff --git a/test/spec/ol/format/wfs.test.js b/test/spec/ol/format/wfs.test.js index 0ad2a86673..a2c888b8b0 100644 --- a/test/spec/ol/format/wfs.test.js +++ b/test/spec/ol/format/wfs.test.js @@ -3,7 +3,7 @@ goog.provide('ol.test.format.WFS'); goog.require('ol.Feature'); goog.require('ol.format.GML2'); goog.require('ol.format.WFS'); -goog.require('ol.format.ogc.filter'); +goog.require('ol.format.filter'); goog.require('ol.geom.MultiLineString'); goog.require('ol.geom.MultiPoint'); goog.require('ol.geom.MultiPolygon'); @@ -277,7 +277,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.equalTo('name', 'New York', false) + filter: ol.format.filter.equalTo('name', 'New York', false) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -305,9 +305,9 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.or( - ol.format.ogc.filter.equalTo('name', 'New York'), - ol.format.ogc.filter.equalTo('area', 1234)) + filter: ol.format.filter.or( + ol.format.filter.equalTo('name', 'New York'), + ol.format.filter.equalTo('area', 1234)) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -347,14 +347,14 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.or( - ol.format.ogc.filter.and( - ol.format.ogc.filter.greaterThan('area', 100), - ol.format.ogc.filter.greaterThanOrEqualTo('pop', 20000) + filter: ol.format.filter.or( + ol.format.filter.and( + ol.format.filter.greaterThan('area', 100), + ol.format.filter.greaterThanOrEqualTo('pop', 20000) ), - ol.format.ogc.filter.and( - ol.format.ogc.filter.lessThan('area', 100), - ol.format.ogc.filter.lessThanOrEqualTo('pop', 20000) + ol.format.filter.and( + ol.format.filter.lessThan('area', 100), + ol.format.filter.lessThanOrEqualTo('pop', 20000) ) ) }); @@ -379,7 +379,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.between('area', 100, 1000) + filter: ol.format.filter.between('area', 100, 1000) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -400,7 +400,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.isNull('area') + filter: ol.format.filter.isNull('area') }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -422,7 +422,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.like('name', 'New*') + filter: ol.format.filter.like('name', 'New*') }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -444,7 +444,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.like('name', 'New*', '*', '.', '!', false) + filter: ol.format.filter.like('name', 'New*', '*', '.', '!', false) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -468,7 +468,7 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.not(ol.format.ogc.filter.equalTo('name', 'New York')) + filter: ol.format.filter.not(ol.format.filter.equalTo('name', 'New York')) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -500,9 +500,9 @@ describe('ol.format.WFS', function() { featureNS: 'http://www.openplans.org/topp', featurePrefix: 'topp', featureTypes: ['states'], - filter: ol.format.ogc.filter.and( - ol.format.ogc.filter.equalTo('name', 'New York'), - ol.format.ogc.filter.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326') + filter: ol.format.filter.and( + ol.format.filter.equalTo('name', 'New York'), + ol.format.filter.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326') ) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); @@ -531,7 +531,7 @@ describe('ol.format.WFS', function() { var serialized = new ol.format.WFS().writeGetFeature({ srsName: 'EPSG:4326', featureTypes: ['area'], - filter: ol.format.ogc.filter.intersects( + filter: ol.format.filter.intersects( 'the_geom', new ol.geom.Polygon([[ [10, 20], @@ -568,7 +568,7 @@ describe('ol.format.WFS', function() { var serialized = new ol.format.WFS().writeGetFeature({ srsName: 'EPSG:4326', featureTypes: ['area'], - filter: ol.format.ogc.filter.within( + filter: ol.format.filter.within( 'the_geom', new ol.geom.Polygon([[ [10, 20],