You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2024/02/22 20:48:43 UTC
(sedona) branch master updated: [SEDONA-501] ST_Split maps to wrong Java-call (#1252)
This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git
The following commit(s) were added to refs/heads/master by this push:
new c057528bc [SEDONA-501] ST_Split maps to wrong Java-call (#1252)
c057528bc is described below
commit c057528bcf825feb90b0eaeb6f5f78fe73205ca5
Author: Niklas Løvenholdt Petersen (Maersk) <11...@users.noreply.github.com>
AuthorDate: Thu Feb 22 21:48:37 2024 +0100
[SEDONA-501] ST_Split maps to wrong Java-call (#1252)
---
python/sedona/sql/st_functions.py | 2 +-
python/tests/sql/test_dataframe_api.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/python/sedona/sql/st_functions.py b/python/sedona/sql/st_functions.py
index 3465b9c16..1f384e865 100644
--- a/python/sedona/sql/st_functions.py
+++ b/python/sedona/sql/st_functions.py
@@ -1270,7 +1270,7 @@ def ST_Split(input: ColumnOrName, blade: ColumnOrName) -> Column:
:return: Multi-geometry representing the split of input by blade.
:rtype: Column
"""
- return _call_st_function("ST_SymDifference", (input, blade))
+ return _call_st_function("ST_Split", (input, blade))
@validate_argument_types
diff --git a/python/tests/sql/test_dataframe_api.py b/python/tests/sql/test_dataframe_api.py
index be8278c72..b783c3e24 100644
--- a/python/tests/sql/test_dataframe_api.py
+++ b/python/tests/sql/test_dataframe_api.py
@@ -145,7 +145,7 @@ test_configurations = [
(stf.ST_SetPoint, ("line", 1, lambda: f.expr("ST_Point(1.0, 1.0)")), "linestring_geom", "", "LINESTRING (0 0, 1 1, 2 0, 3 0, 4 0, 5 0)"),
(stf.ST_SetSRID, ("point", 3021), "point_geom", "ST_SRID(geom)", 3021),
(stf.ST_SimplifyPreserveTopology, ("geom", 0.2), "0.9_poly", "", "POLYGON ((0 0, 1 0, 1 1, 0 0))"),
- (stf.ST_Split, ("a", "b"), "overlapping_polys", "", "MULTIPOLYGON (((1 0, 0 0, 0 1, 1 1, 1 0)), ((2 0, 2 1, 3 1, 3 0, 2 0)))"),
+ (stf.ST_Split, ("line", "points"), "multipoint_splitting_line", "", "MULTILINESTRING ((0 0, 0.5 0.5), (0.5 0.5, 1 1), (1 1, 1.5 1.5, 2 2))"),
(stf.ST_SRID, ("point",), "point_geom", "", 0),
(stf.ST_StartPoint, ("line",), "linestring_geom", "", "POINT (0 0)"),
(stf.ST_SubDivide, ("line", 5), "linestring_geom", "", ["LINESTRING (0 0, 2.5 0)", "LINESTRING (2.5 0, 5 0)"]),
@@ -437,6 +437,8 @@ class TestDataFrameAPI(TestBase):
return TestDataFrameAPI.spark.sql("SELECT ST_GeomFromWKT('POINT (0.0 1.0)') AS point, ST_GeomFromWKT('LINESTRING (0 0, 1 0, 2 0, 3 0, 4 0, 5 0)') AS line")
elif request.param == "line_and_point":
return TestDataFrameAPI.spark.sql("SELECT ST_GeomFromWKT('LINESTRING (0 2, 1 1, 2 0)') AS line, ST_GeomFromWKT('POINT (0 0)') AS point")
+ elif request.param == "multipoint_splitting_line":
+ return TestDataFrameAPI.spark.sql("SELECT ST_GeomFromWKT('LINESTRING (0 0, 1.5 1.5, 2 2)') AS line, ST_GeomFromWKT('MULTIPOINT (0.5 0.5, 1 1)') AS points")
elif request.param == "origin_and_point":
return TestDataFrameAPI.spark.sql("SELECT ST_GeomFromWKT('POINT (0 0)') AS origin, ST_GeomFromWKT('POINT (1 0)') as point")
elif request.param == "ny_seattle":