Abeeujah commented on code in PR #229:
URL: https://github.com/apache/sedona-db/pull/229#discussion_r2443257711
##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -211,6 +211,42 @@ def test_st_centroid(eng, geom, expected):
eng.assert_query_result(f"SELECT ST_Centroid({geom_or_null(geom)})",
expected)
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("geom", "expected"),
+ [
+ (None, None),
+ ("POINT (0 0)", True),
+ ("POINT EMPTY", True),
+ ("LINESTRING (0 0, 1 1)", True),
+ ("LINESTRING EMPTY", True),
Review Comment:
This is considered valid, cause unlike polygons, self-intersection does not
invalidate a LineString in most standard spatial models (like OGC SFA or ISO
19107) which I believe the geos library based their implementation upon
A **LINESTRING** is generally considered valid if it meets two main
conditions, and the geometry you provided adheres to both:
1. A LineString must have at least two distinct points, or be empty.
`LINESTRING (0 0, 1 1, 1 0, 0 1)` has four distinct points.
2. No two consecutive points can be identical (no "spikes"). The points in
your LineString are distinct and non-consecutive.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]