Commit Graph

14 Commits

Author SHA1 Message Date
ahocevar
4f2d37b6a3 New ThisIdentifier expression
This allows member expressions to use the 'this' keyword.
2013-08-29 16:50:52 +02:00
Tim Schaub
9755240cac Leaving the + operator as a convenience for concatenating strings
When people need to serialize in a format that differentiates string concatenation from addition, they can use the new `concat` function in an expression.  But I don't think we need to throw if people use `+` with strings.
2013-08-23 18:33:52 -04:00
Tim Schaub
3b615fa312 Add a concat function for concatenating strings 2013-08-23 13:05:12 -04:00
Bart van den Eijnden
09c27f430d remove accidentally committed swap file 2013-08-09 15:58:31 +02:00
Bart van den Eijnden
29954d2ff9 trim the string before passing it off to ol.expr.parse 2013-08-09 11:08:19 +02:00
Bart van den Eijnden
369d692a90 implement @tschaub's suggestions for ieq and ineq 2013-07-22 14:11:29 +02:00
Bart van den Eijnden
875edc540e implement @tschaub's suggestions for the LIKE function 2013-07-22 13:23:08 +02:00
Bart van den Eijnden
499319fb99 address most of @tschaub's review comments, use dot notation where possible still needs to be done, and I have some questions on the _expression reader still 2013-07-08 17:04:27 +02:00
Bart van den Eijnden
ab40ab6208 Add parser for OGC Filter 1.0 and 1.1 (read/write)
This work is based on the ol.expr package by @tschaub.
It adds a few named expression functions to that package:

 * INTERSECTS, CONTAINS, DWITHIN, WITHIN (no client-side implementation as yet)
 * LIKE (like comparison with wildcard, singleChar and escapeChar)
 * IEQ (case-insensitive equality)
 * INEQ (case-insensitive non-equality)

It also adds a few extra parameters to the existing EXTENT function to be able
to deserialize and serialize all info (i.e. projection and property name).

Some changes were needed for the GML parser as well:

 * createGeometry function needed to be public
 * when parsing Box (GML2) and Envelope (GML3) also parse the srsName
 * fix up writing for Box and Envelope now that bounds is an array

Also added createDocumentFragment function to the XML parser. Implementation
is similar to OpenLayers 2.

Some addtional notes on the implementation:

 * PropertyIsBetween was implemented as an ol.expr.Logical with operator
   ol.expr.LogicalOp.AND and two ol.expr.Comparison instances with operator
   ol.expr.ComparisonOp.GTE and ol.expr.ComparisonOp.LTE
 * In OGC Filter And and Or can contain more than 2 sub filters, so this
   is translated into a hierarchy of ol.expr.Logical
2013-07-03 13:09:25 +02:00
Tim Schaub
71153d26d1 Prefer if/else to switch 2013-06-26 17:01:27 -06:00
Tim Schaub
4e5ef05e5e Expression for evaluating feature ids 2013-06-25 12:15:34 -06:00
Tim Schaub
1eaf82ead5 Enum for checking built-in lib functions internally 2013-06-25 12:15:34 -06:00
Tim Schaub
c81057780a More tests for binary operators 2013-06-25 12:15:34 -06:00
Tim Schaub
2577d3f7d6 Rename ol.expression to ol.expr 2013-06-25 12:15:34 -06:00