Skip to content

Commit

Permalink
Correct documentation on comparing spatial values (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPryce-Aklundh committed Aug 19, 2024
1 parent db22543 commit 42abd34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ label:removed[]
point({x:0, y:0}) <= point({x:1, y:1}) <= point({x:2, y:2})
----
a|
The ability to use operators `<`, `<=`, `>`, and `>=` on spatial points is removed.
The ability to use operators `<`, `+<=+`, `>`, or `>=` on spatial points is removed.
Instead, use:
[source, cypher, role="noheader"]
----
Expand Down
8 changes: 3 additions & 5 deletions modules/ROOT/pages/syntax/operators.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,9 @@ The following points give some details on how the comparison is performed.
For example, `1 > b` and `1 < b` are both false when b is NaN.
* String values are compared for ordering using lexicographic order (e.g. `"x" < "xy"`).
* Boolean values are compared for ordering such that `false < true`.
* *Comparison* of spatial values:
** Point values can only be compared within the same Coordinate Reference System (CRS) -- otherwise, the result will be `null`.
** For two points `a` and `b` within the same CRS, `a` is considered to be greater than `b` if `a.x > b.x` and `a.y > b.y` (and `a.z > b.z` for 3D points).
** `a` is considered less than `b` if `a.x < b.x` and `a.y < b.y` (and `a.z < b.z` for 3D points).
** If none if the above is true, the points are considered incomparable and any comparison operator between them will return `null`.
* Spatial values cannot be compared using the operators `<`, `+<=+`, `>`, or `>=`.
To compare spatial values within a specific range, use either the xref:functions/spatial.adoc#functions-withinBBox[`point.withinBBox()`] or the xref:functions/spatial.adoc#functions-point-wgs84-2d[`point()`] function.

* *Ordering* of spatial values:
** `ORDER BY` requires all values to be orderable.
** Points are ordered after arrays and before temporal types.
Expand Down

0 comments on commit 42abd34

Please sign in to comment.