petern48 commented on code in PR #691:
URL: https://github.com/apache/sedona-db/pull/691#discussion_r2936926842


##########
rust/sedona-functions/src/lib.rs:
##########
@@ -51,6 +51,7 @@ mod st_point;
 mod st_pointn;
 mod st_points;
 mod st_pointzm;
+pub mod st_relate;

Review Comment:
   ```suggestion
   mod st_relate;
   ```
   
   Let's not make this public, similar to how the rest of these modules aren't 
public



##########
python/sedonadb/tests/functions/test_predicates.py:
##########
@@ -335,10 +335,6 @@ def test_st_within(eng, geom1, geom2, expected):
 @pytest.mark.parametrize(
     ("geom1", "geom2", "expected"),
     [
-        # These cases demonstrates the weirdness of ST_Contains:
-        # Both POINT(0 0) and GEOMETRYCOLLECTION (POINT (0 0)) contains POINT 
(0 0),
-        # but GEOMETRYCOLLECTION (POINT (0 0), LINESTRING (0 0, 1 1)) does not 
contain POINT (0 0).
-        # See 
https://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html

Review Comment:
   let's not delete this comment either.



##########
python/sedonadb/tests/functions/test_predicates.py:
##########
@@ -442,3 +438,34 @@ def test_st_overlaps(eng, geom1, geom2, expected):
         f"SELECT ST_Overlaps({geom_or_null(geom1)}, {geom_or_null(geom2)})",
         expected,
     )
+
+
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+    ("geom1", "geom2", "expected"),
+    [
+        (None, None, None),
+        ("POINT (0 0)", None, None),
+        (None, "POINT (0 0)", None),
+        ("POINT (0 0)", "POINT (1 1)", "FF0FFF0F2"),
+        ("POINT (0 0)", "POINT (0 0)", "0FFFFFFF2"),
+        ("POINT (0 0)", "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))", "F0FFFF212"),
+        ("POINT (0.5 0.5)", "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))", 
"0FFFFF212"),
+        (
+            "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))",
+            "POLYGON ((5 5, 6 5, 6 6, 5 6, 5 5))",
+            "FF2FF1212",
+        ),
+        (
+            "POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))",
+            "POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1))",
+            "212101212",
+        ),

Review Comment:
   I'd like to add some more edge cases. (We are usually more comprehensive for 
the Python tests, since they are very concise to write)
   
   Could we add the following test cases? (These are just the inputs, you need 
to add the expected output values. I find the easiest way is to just run the 
tests, and copy-paste the outputs that come out. If both our sedonaDB 
implementation and PostGIS agree, we're good!)
   
   If you come up with any other interesting edge cases, you're welcome to add 
them too.
   
   ```
   ("POINT (0 0)", "LINESTRING (0 0, 1 1)")
   ("LINESTRING (0 0, 2 2)", "LINESTRING (1 1, 3 3)")
   ("GEOMETRYCOLLECTION (POINT (0 0), LINESTRING (0 0,1 1))", "POINT (0 0)")
   (
    "POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))",
    "POLYGON ((2 0, 4 0, 4 2, 2 2, 2 0))"
   )  # touching polygons
   (
    "POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))",
    "POLYGON ((1 1, 2 1, 2 2, 1 2, 1 1))"
   ) # polygon containment
   (
    "POLYGON ((0 0,6 0,6 6,0 6,0 0),(2 2,4 2,4 4,2 4,2 2))",
    "POINT (1 1)"
   )  # point in a polygon hole
   
   
   



-- 
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]

Reply via email to