Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct documentation on comparing spatial values #1023

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,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
Loading