Skip to content

Commit

Permalink
release(v0.3.1)
Browse files Browse the repository at this point in the history
release(v0.3.1)
  • Loading branch information
nkarasiak authored Nov 22, 2024
2 parents 1cc4c95 + b2ede1c commit f01b2a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1] - 2024-11-22

### Fixed

- wkt geometries have now the full precision when storing it in zonal stats.

## [0.3.0] - 2024-11-19

### Added
Expand Down
2 changes: 1 addition & 1 deletion earthdaily/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# to hide warnings from rioxarray or nano seconds conversion
# warnings.filterwarnings("ignore")

__version__ = "0.3.0"
__version__ = "0.3.1"


def EarthDataStore(
Expand Down
7 changes: 5 additions & 2 deletions earthdaily/earthdatastore/cube_utils/_zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _loop_time_chunks(dataset, method, smart_load, time_chunks):
geoms.to_crs(input_crs)

if method == "numpy":
feats, yx_pos = _rasterize(geoms, dataset, all_touched=all_touched)
feats, yx_pos = _rasterize(geoms.copy(), dataset, all_touched=all_touched)
positions = [np.asarray(yx_pos[i + 1]) for i in np.arange(geoms.shape[0])]
positions = [position for position in positions if position.size > 0]
del yx_pos
Expand Down Expand Up @@ -213,8 +213,11 @@ def _loop_time_chunks(dataset, method, smart_load, time_chunks):
# create the WKT geom
if isinstance(buffer_meters, float | int):
geoms.geometry = geoms["geometry_original"]

if geoms.crs.to_epsg() != 4326:
geoms = geoms.to_crs("EPSG:4326")
geometry = xr.DataArray(
list(geoms.iloc[f - 1].to_crs("EPSG:4326").geometry.to_wkt()),
geoms.iloc[list(f - 1)].geometry.apply(lambda x: x.wkt).values,
dims=["feature"],
coords={"feature": zs.feature.values},
)
Expand Down

0 comments on commit f01b2a9

Please sign in to comment.