ogcapi-features
ogcapi-features copied to clipboard
Spatial operators
Closes #734 Addresses two of three items in #733
Meeting 2022-09-12: We will keep this open for reviews now. @pvretano has concerns about the use of "constructor", e.g., for CASEI. We will think about this topic until the next meeting.
(short story: I agree with Peter that CASEI() and ACCENTI() are not constructors, but standardized text manipulation functions)
@pvretano @cportele You may be interested in the conceptual work that we have been doing in Styles & Symbology trying to UML-ify a conceptual model for expressions based on the Testbed 14 work, for potential inclusion in a revision of SymCore (or extension), intending it to fully cover CQL2 capabilities.
In this model, the concept of InstanceExpression illustrates this idea of constructor. In CQL2/WKT, this corresponds to the Geometry constructors and TimeInstant/TimeInterval usage.
But for CASEI() and ACCENTI(), these rather correspond to standard text manipulation functions (called caseInsensitize() and accentInsensitize() there).
Also note the InstanceLiteral inheriting from both LiteralExpression and InstanceExpression, which is for InstanceExpressions for which all values are fixed in the code (all member values are also LiteralExpressions).
Like WKT, CQL2 uses parentheses ( ) for function calls, constructors and lists/arrays (related to #718 where I suggest that should also be consistent for ArrayExpressions used with the IN operator), whereas our CMSS and JSON uses curlies { } for InstanceExpressions and square brackets [ ] for ArrayExpressions.
Along with the operators, I believe these four UML diagrams (expressions / operators / standard functions / geometry -- currently missing MultiPolygon) fully covers the CQL2 functionality (and a bit more). From these, CQL2 does not have:
- the ConditionalExpression, VariableExpression and EnumValueLiteral (except for BoolLiteral),
- the (not)contains/startsWith/endsWith operators (it has
likeinstead), - the bitwise operators,
- the other text manipulation functions,
- the geometry manipulation functions, and
- the s_covers() / s_coveredBy() spatial relation functions.
Meeting 2022-09-26: Change CASEI and ACCENTI not to be constructors, but "standardized functions". @cportele to update the PR including the terms and definitions.
@pvretano will have a look, if we can change all operators with a function-like syntax to functions in the grammar and define the functions separately.