Skip to content

Commit 48a0213

Browse files
author
nicolasK
committed
fix(search) : bbox
1 parent 55dbf9c commit 48a0213

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

earthdaily/earthdatastore/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,12 +1030,13 @@ def datacube(
10301030
assets.append(sensor_mask)
10311031
elif isinstance(assets, dict):
10321032
assets[sensor_mask] = sensor_mask
1033-
if bbox is None and intersects:
1033+
bbox_query = None
1034+
1035+
if bbox is None and intersects is not None:
10341036
bbox_query = list(cube_utils.GeometryManager(intersects).to_bbox())
1035-
if bbox:
1037+
elif bbox is not None and intersects is None:
10361038
bbox_query = bbox
1037-
else:
1038-
bbox_query = None
1039+
10391040
# query the items
10401041
items = self.search(
10411042
collections=collections,

tests/test_zonalstats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def setUp(self, constant=np.random.randint(1, 12)):
3434
Polygon([(0, 0), (0, 0.5), (0.5, 0.5), (0.5, 0)]),
3535
Polygon([(1, 1), (9, 1), (9, 2.1), (1, 1)])
3636
]
37-
# out of bound geom # Polygon([(10,10), (10,11), (11,11), (11,10)])]
37+
3838
gdf = gpd.GeoDataFrame({"geometry": geometry}, crs="EPSG:4326")
3939
gdf.index = ['ok1', 'nok', 'ok2']
4040
gdf['label'] = [1, 1, 5]

0 commit comments

Comments
 (0)