diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6d6a33c..5d712e4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,12 +13,17 @@ Changed ^^^^^^^ something was changed -[master] (2020-**-**) ----------------------- +[1.0.2] (2020-01-22) + +--------------------- Changed ^^^^^^^ - ``raster``: documentation clarification for `Image` initialization with `nodata` #105 +Fixed +^^^^^ +- ``data``: bugfix stacapi, bbox did not work because it has to be post like intersection + [1.0.1] (2020-01-20) --------------------- Changed diff --git a/tests/test_stacapi.py b/tests/test_stacapi.py index 3ac2005..da6782d 100644 --- a/tests/test_stacapi.py +++ b/tests/test_stacapi.py @@ -46,6 +46,14 @@ def test_get_item_intersects(self): ) self.assertEqual(3, cnt) + def test_get_item_bbox(self): + cnt = self.api.count( + collection="sentinel-s2-l2a", + bbox=[-110, 39.5, -105, 40.5], + datetime=r"2020-04-01T00:00:00Z/2020-04-01T23:59:59Z", + ) + self.assertEqual(30, cnt) + def test_get_items_limit(self, limit=31): items = self.api.get_items(collection="sentinel-s2-l2a", intersects=self.aoi, limit=limit) self.assertEqual(limit, len(items)) diff --git a/ukis_pysat/__init__.py b/ukis_pysat/__init__.py index ca651cc..d10af32 100644 --- a/ukis_pysat/__init__.py +++ b/ukis_pysat/__init__.py @@ -1 +1 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" diff --git a/ukis_pysat/stacapi.py b/ukis_pysat/stacapi.py index cb40ced..e21e50b 100644 --- a/ukis_pysat/stacapi.py +++ b/ukis_pysat/stacapi.py @@ -39,7 +39,8 @@ def _handle_query(self, url=None, headers=None, **kwargs): @staticmethod def _query(url, kwargs, headers): - if "intersects" in kwargs: # TODO intersects will be deprecated with v1.0.0-beta.2 and replaced with OGC CQL + if {"intersects", "bbox"}.intersection(kwargs): + # TODO intersects will be deprecated with v1.0.0-beta.2 and replaced with OGC CQL return requests.post(url, json=kwargs, headers=headers) else: return requests.get(url, kwargs, headers=headers)