From bd1d7a54bfd0be9d58239ff21a63e811d58b181c Mon Sep 17 00:00:00 2001 From: nicolasK Date: Mon, 16 Dec 2024 16:06:25 +0100 Subject: [PATCH] fix(zonal_stats) : wkt --- earthdaily/earthdatastore/cube_utils/_zonal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/earthdaily/earthdatastore/cube_utils/_zonal.py b/earthdaily/earthdatastore/cube_utils/_zonal.py index aa0482c2..7994515b 100644 --- a/earthdaily/earthdatastore/cube_utils/_zonal.py +++ b/earthdaily/earthdatastore/cube_utils/_zonal.py @@ -212,8 +212,9 @@ def _loop_time_chunks(dataset, method, smart_load, time_chunks): if geoms.crs.to_epsg() != 4326: geoms = geoms.to_crs("EPSG:4326") + geometry = xr.DataArray( - geoms.iloc[list(f - 1)].geometry.apply(lambda x: x.wkt).values, + geoms.geometry.iloc[list(f-1)].to_wkt(rounding_precision=-1).values, dims=["feature"], coords={"feature": zs.feature.values}, )