diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ab5aee..9bfce3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ 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.0.15] - 2024-04-11 + +### Fixed + +- `ag_cloud_mask_items` queries items per batch. + + ## [0.0.14] - 2024-04-11 ### Fixed diff --git a/earthdaily/__init__.py b/earthdaily/__init__.py index 6ceb0056..6014879e 100644 --- a/earthdaily/__init__.py +++ b/earthdaily/__init__.py @@ -5,4 +5,4 @@ # to hide warnings from rioxarray or nano seconds conversion warnings.filterwarnings("ignore") -__version__ = "0.0.14" +__version__ = "0.0.15" diff --git a/earthdaily/earthdatastore/__init__.py b/earthdaily/earthdatastore/__init__.py index b93e27a3..008a89ab 100644 --- a/earthdaily/earthdatastore/__init__.py +++ b/earthdaily/earthdatastore/__init__.py @@ -650,6 +650,7 @@ def datacube( if intersects is not None: intersects = cube_utils.GeometryManager(intersects).to_geopandas() + self.intersects = intersects items = self.search( collections=collections, bbox=bbox, @@ -941,8 +942,17 @@ def ag_cloud_mask_from_items(items): if len(items_id) == 0: raise ValueError("Sorry, no ag_cloud_mask available.") collections = list(items_id.keys()) - ids = [x for n in (items_id.values()) for x in n] - return self.search(collections=collections, ids=ids) + ids_ = [x for n in (items_id.values()) for x in n] + items_list = [] + step = 100 + for items_start_idx in range(0, len(ids_), step): + items = self.search( + collections=collections, + intersects=self.intersects, + ids=ids_[items_start_idx : items_start_idx + step], + ) + items_list.extend(items) + return ItemCollection(items) def item_property_to_df(