Skip to content

Commit

Permalink
bugfix STAC API, version bump (#107)
Browse files Browse the repository at this point in the history
* bugfix STAC API, version bump

* Update CHANGELOG.rst
  • Loading branch information
fwfichtner authored Jan 22, 2021
1 parent fde94a5 commit e9290ed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/test_stacapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion ukis_pysat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.1"
__version__ = "1.0.2"
3 changes: 2 additions & 1 deletion ukis_pysat/stacapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e9290ed

Please sign in to comment.