petern48 commented on code in PR #2493:
URL: https://github.com/apache/sedona/pull/2493#discussion_r2518926416
##########
python/tests/geopandas/test_match_geopandas_series.py:
##########
@@ -833,7 +833,26 @@ def test_transform(self):
pass
def test_force_2d(self):
- pass
+ # force_2d was added from geopandas 1.0.0
+ if parse_version(gpd.__version__) < parse_version("1.0.0"):
+ pytest.skip("geopandas force_2d requires version 1.0.0 or higher")
+ # 1) No-op on existing 2D fixtures
+ for geom in self.geoms:
+ sgpd_result = GeoSeries(geom).force_2d()
+ gpd_result = gpd.GeoSeries(geom).force_2d()
+ self.check_sgpd_equals_gpd(sgpd_result, gpd_result)
+
+ # 2) Minimal 3D sample to verify Z is actually stripped
+ data = [
+ Point(0, -1, 2.5),
+ LineString([(0, 0, 1), (1, 1, 2)]),
+ Polygon([(0, 0, 1), (1, 0, 2), (1, 1, 3), (0, 0, 1)]),
+ Point(5, 5), # already 2D
+ Polygon(), # empty geometry
Review Comment:
Let's add just a single `M` case and `ZM` case. Already passes, when I
tested locally.
--
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]