joonaspessi commented on code in PR #231:
URL: https://github.com/apache/sedona-db/pull/231#discussion_r2443900267
##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -604,6 +604,52 @@ def test_st_isclosed(eng, geom, expected):
eng.assert_query_result(f"SELECT ST_IsClosed({geom_or_null(geom)})",
expected)
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("geom", "expected"),
+ [
+ (None, None),
+ # Valid rings
+ ("LINESTRING(0 0, 0 1, 1 1, 1 0, 0 0)", True),
+ ("LINESTRING(0 0, 1 0, 1 1, 0 0)", True),
+ ("LINESTRING(0 0, 2 2, 1 2, 0 0)", True),
+ # Closed but self-intersecting - bowtie shape
+ ("LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)", False),
+ # Not closed
+ ("LINESTRING(0 0, 1 1)", False),
+ ("LINESTRING(2 0, 2 2, 3 3)", False),
+ ("LINESTRING(0 0, 2 2)", False),
+ # Empty LineString
+ ("LINESTRING EMPTY", False),
Review Comment:
Makes sense. Added these under `test_st_isring_non_linestring` as PostGis is
throwing error on these.
--
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]