paleolimbot commented on code in PR #816:
URL: https://github.com/apache/sedona-db/pull/816#discussion_r3230299011
##########
python/sedonadb/tests/geography/test_geog_transformations.py:
##########
@@ -37,3 +37,839 @@ def test_st_centroid(eng, geom, expected):
eng.assert_query_result(
f"SELECT ST_Centroid({geog_or_null(geom)})", expected, wkt_precision=4
)
+
+
[email protected]("eng", [SedonaDB, BigQuery])
[email protected](
+ ("geog", "expected"),
+ [
+ # Nulls
+ pytest.param(None, None, id="null_centroid"),
+ # Empties
+ pytest.param("POINT EMPTY", "GEOMETRYCOLLECTION EMPTY",
id="point_empty"),
+ pytest.param(
+ "LINESTRING EMPTY", "GEOMETRYCOLLECTION EMPTY",
id="linestring_empty"
+ ),
+ pytest.param("POLYGON EMPTY", "GEOMETRYCOLLECTION EMPTY",
id="polygon_empty"),
+ # Points
+ pytest.param("POINT (0 1)", "POINT (0 1)", id="point"),
+ pytest.param("MULTIPOINT ((0 0), (0 1))", "POINT (0 0.5)",
id="multipoint"),
+ # Linestrings
+ pytest.param("LINESTRING (0 0, 0 1)", "POINT (0 0.5)",
id="linestring"),
+ pytest.param(
+ "LINESTRING (0 0, 0 1, 0 5)", "POINT (0 2.5)",
id="linestring_two_segments"
Review Comment:
I added a polar case here!
--
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]