ogcapi-features
ogcapi-features copied to clipboard
CQL2: Spatial Operators Issues
In Table 2 of 7.6, some of the mathematical definitions seem incorrect:
-
S_CONTAINSis defined asS_CONTAINS(a,b) ⬄ b CONTAINS a-- First, I think it should have been the other way around,a CONTAINS b. But that definition would still be ambiguous. The SFA definition on page 39 (XXXIX) is defined asb.Within(a), because Intersects and Contains are convenience wrappers around Disjoint and Within respectively. Within itself is unambiguously defined mathematically. Perhaps the intent was for this to beS_CONTAINS(a,b) ⬄ b WITHIN a. This is quite important because the actual meaning of Contains is particularly counter-intuitive, as the Wikipedia page states:- The predicates Contains and Within have subtle aspects to their definition which are contrary to intuition. For example,[10] a line L which is completely contained in the boundary of a polygon P is not considered to be contained in P. This quirk can be expressed as "Polygons do not contain their boundary". This issue is caused by the final clause of the Contains definition above: "at least one point of the interior of B lies in the interior of A". For this case, the predicate Covers has more intuitive semantics (see definition), avoiding boundary considerations.
- A related question is whether CQL2 should define Covers and CoveredBy as recommended instead of (or in addition to) Contains and Within?
-
S_WITHINis defined asS_WITHIN(a,b) ⬄ (a ∩ b = a) ∧ (I(a) ∩ E(b) ≠ ∅), however I believe that should beS_WITHIN(a,b) ⬄ (a ∩ b = a) ∧ (I(a) ∩ E(b) = ∅), (= ∅, the interior of A should not intersect with the exterior of B for a to be within b), so their intersection is equal to the empty set, as it is on page 38 of Simple Features Access. - It would be useful to explain that
I(a)means the interior of a andE(a)means the exterior of A (B(a)means the boundary of a, but that was only used in the DE9IM definitions).
Meeting 2022-07-22:
-
b WITHIN ais correct. - We reference Simple Feature Access, where Covers and CoveredBy are not included. For v1.0 we will keep the list as in SFA, we can add more in future revisions, if we see that other spatial operators are used a lot in practice.
-
= ∅is correct. - Add an explanation about the notation (
I(a),E(a)).