petern48 commented on code in PR #2416:
URL: https://github.com/apache/sedona/pull/2416#discussion_r2525871343
##########
python/tests/geopandas/test_geoseries.py:
##########
@@ -1462,6 +1500,21 @@ def test_crosses(self):
df_result = s.to_geoframe().crosses(s2, align=False).to_pandas()
assert_series_equal(df_result, expected)
+ # Sedona ST_Crosses doesn't support GeometryCollection, so it returns
NULL for now.
+ # https://github.com/apache/sedona/issues/2417
+ # Once this is resolved, we can update the expected result of this
test.
+ # Ensure M-dimension doesn't break things.
+ s = GeoSeries(
+ [
+ wkt.loads("GEOMETRYCOLLECTION M (POINT M (1 2 3))"),
+ wkt.loads("LINESTRING M (0 0 1, 1 1 2)"),
+ ]
+ )
+ line = LineString([(0, 0), (1, 1)])
+ result = s.crosses(line)
+ expected = pd.Series([None, False])
+ assert_series_equal(result.to_pandas(), expected)
Review Comment:
```suggestion
self.check_pd_series_equal(result, expected)
```
##########
python/tests/geopandas/test_geoseries.py:
##########
@@ -677,6 +677,21 @@ def test_length(self):
df_result = geoseries.to_geoframe().length.to_pandas()
assert_series_equal(df_result, expected)
+ # Ensure M-dimension doesn't break things.
+ s = GeoSeries(
+ [
+ wkt.loads("POINT M (0 0 0)"),
+ wkt.loads("LINESTRING M (0 0 0, 1 1 0)"),
+ wkt.loads("POLYGON M ((0 0 0, 1 0 0, 1 1 0, 0 0 0))"),
+ wkt.loads(
+ "GEOMETRYCOLLECTION M (POINT M (0 0 0), LINESTRING M (0 0
0, 1 1 0), POLYGON M ((0 0 0, 1 0 0, 1 1 0, 0 0 0)))"
+ ),
+ ]
+ )
+ result = s.length.to_pandas()
+ expected = pd.Series([0.000000, 1.414214, 3.414214, 4.828427])
+ assert_series_equal(result, expected)
Review Comment:
```suggestion
result = s.length
expected = pd.Series([0.000000, 1.414214, 3.414214, 4.828427])
self.check_pd_series_equal(result, expected)
```
--
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]