From d13512e3f43b90e6a7342683d4494167d6e24269 Mon Sep 17 00:00:00 2001 From: Daniel Lusk Date: Tue, 12 Nov 2024 14:46:17 +0100 Subject: [PATCH] fix missing crs in metadata for points_from_xy (#316) --- dask_geopandas/core.py | 2 +- dask_geopandas/expr.py | 2 +- dask_geopandas/tests/test_core.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dask_geopandas/core.py b/dask_geopandas/core.py index b448319..4ef455c 100644 --- a/dask_geopandas/core.py +++ b/dask_geopandas/core.py @@ -878,7 +878,7 @@ def func(data, x, y, z): ) return df.map_partitions( - func, x, y, z, meta=geopandas.GeoSeries(), token="points_from_xy" + func, x, y, z, meta=geopandas.GeoSeries(crs=crs), token="points_from_xy" ) diff --git a/dask_geopandas/expr.py b/dask_geopandas/expr.py index a14e8bc..dcdafa8 100644 --- a/dask_geopandas/expr.py +++ b/dask_geopandas/expr.py @@ -910,7 +910,7 @@ def func(data, x, y, z): ) return df.map_partitions( - func, x, y, z, meta=geopandas.GeoSeries(), token="points_from_xy" + func, x, y, z, meta=geopandas.GeoSeries(crs=crs), token="points_from_xy" ) diff --git a/dask_geopandas/tests/test_core.py b/dask_geopandas/tests/test_core.py index f5f089c..e46ec7c 100644 --- a/dask_geopandas/tests/test_core.py +++ b/dask_geopandas/tests/test_core.py @@ -181,6 +181,7 @@ def test_points_from_xy_with_crs(): ) assert isinstance(actual, dask_geopandas.GeoSeries) assert_geoseries_equal(actual.compute(), expected) + assert actual.crs == expected.crs def test_from_wkt():