-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use between as temporal operator with QGIS
- Loading branch information
1 parent
ba665ff
commit 140e9d4
Showing
2 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @module ngeo.format.filter | ||
*/ | ||
import olFormatFilterComparison from 'ol/format/filter/Comparison.js'; | ||
|
||
/** | ||
* @classdesc | ||
* Represents a `<PropertyIsBetween>` temporal comparison operator, | ||
* suitable for QGIS server that does not support `<During>`. | ||
*/ | ||
class DateIsBetween extends olFormatFilterComparison { | ||
|
||
/** | ||
* @param {!string} propertyName Name of the context property to compare. | ||
* @param {!string} lowerBoundary The lower bound of the range. | ||
* @param {!string} upperBoundary The upper bound of the range. | ||
*/ | ||
constructor(propertyName, lowerBoundary, upperBoundary) { | ||
super('PropertyIsBetween', propertyName); | ||
|
||
/** | ||
* @type {!string} | ||
*/ | ||
this.lowerBoundary = lowerBoundary; | ||
|
||
/** | ||
* @type {!string} | ||
*/ | ||
this.upperBoundary = upperBoundary; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Creates a `<PropertyIsBetween>` comparison operator to test whether an expression | ||
* value lies within a time range given by a lower and upper bound (inclusive). | ||
* | ||
* @param {!string} propertyName Name of the context property to compare. | ||
* @param {!string} lowerBoundary The lower bound of the range. | ||
* @param {!string} upperBoundary The upper bound of the range. | ||
* @returns {!ngeo.format.filter.DateIsBetween} `<PropertyIsBetween>` operator. | ||
*/ | ||
export function dateBetween(propertyName, lowerBoundary, upperBoundary) { | ||
return new DateIsBetween(propertyName, lowerBoundary, upperBoundary); | ||
} |