Skip to content

Commit f01b2a9

Browse files
authored
release(v0.3.1)
release(v0.3.1)
2 parents 1cc4c95 + b2ede1c commit f01b2a9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.1] - 2024-11-22
8+
9+
### Fixed
10+
11+
- wkt geometries have now the full precision when storing it in zonal stats.
12+
713
## [0.3.0] - 2024-11-19
814

915
### Added

earthdaily/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# to hide warnings from rioxarray or nano seconds conversion
88
# warnings.filterwarnings("ignore")
99

10-
__version__ = "0.3.0"
10+
__version__ = "0.3.1"
1111

1212

1313
def EarthDataStore(

earthdaily/earthdatastore/cube_utils/_zonal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _loop_time_chunks(dataset, method, smart_load, time_chunks):
183183
geoms.to_crs(input_crs)
184184

185185
if method == "numpy":
186-
feats, yx_pos = _rasterize(geoms, dataset, all_touched=all_touched)
186+
feats, yx_pos = _rasterize(geoms.copy(), dataset, all_touched=all_touched)
187187
positions = [np.asarray(yx_pos[i + 1]) for i in np.arange(geoms.shape[0])]
188188
positions = [position for position in positions if position.size > 0]
189189
del yx_pos
@@ -213,8 +213,11 @@ def _loop_time_chunks(dataset, method, smart_load, time_chunks):
213213
# create the WKT geom
214214
if isinstance(buffer_meters, float | int):
215215
geoms.geometry = geoms["geometry_original"]
216+
217+
if geoms.crs.to_epsg() != 4326:
218+
geoms = geoms.to_crs("EPSG:4326")
216219
geometry = xr.DataArray(
217-
list(geoms.iloc[f - 1].to_crs("EPSG:4326").geometry.to_wkt()),
220+
geoms.iloc[list(f - 1)].geometry.apply(lambda x: x.wkt).values,
218221
dims=["feature"],
219222
coords={"feature": zs.feature.values},
220223
)

0 commit comments

Comments
 (0)