File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
stac_fastapi/elasticsearch
stac_fastapi/elasticsearch Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,14 @@ async def item_collection(
103103 request : Request = kwargs ["request" ]
104104 base_url = str (request .base_url )
105105
106- collection = await self .get_collection (collection_id = collection_id , request = request )
106+ collection = await self .get_collection (
107+ collection_id = collection_id , request = request
108+ )
107109 try :
108110 collection_id = collection ["id" ]
109- except :
111+ except Exception :
110112 raise HTTPException (status_code = 404 , detail = "Collection not found" )
111-
113+
112114 search = self .database .make_search ()
113115 search = self .database .apply_collections_filter (
114116 search = search , collection_ids = [collection_id ]
@@ -124,7 +126,7 @@ async def item_collection(
124126 bbox = [float (x ) for x in bbox ]
125127 if len (bbox ) == 6 :
126128 bbox = [bbox [0 ], bbox [1 ], bbox [3 ], bbox [4 ]]
127-
129+
128130 search = self .database .apply_bbox_filter (search = search , bbox = bbox )
129131
130132 items , maybe_count , next_token = await self .database .execute_search (
Original file line number Diff line number Diff line change @@ -196,13 +196,17 @@ async def test_item_collection_filter_bbox(app_client, ctx):
196196 collection = item ["collection" ]
197197
198198 bbox = "100,-50,170,-20"
199- resp = await app_client .get (f"/collections/{ collection } /items" , params = {"bbox" : bbox })
199+ resp = await app_client .get (
200+ f"/collections/{ collection } /items" , params = {"bbox" : bbox }
201+ )
200202 assert resp .status_code == 200
201203 resp_json = resp .json ()
202204 assert len (resp_json ["features" ]) == 1
203205
204206 bbox = "1,2,3,4"
205- resp = await app_client .get (f"/collections/{ collection } /items" , params = {"bbox" : bbox })
207+ resp = await app_client .get (
208+ f"/collections/{ collection } /items" , params = {"bbox" : bbox }
209+ )
206210 assert resp .status_code == 200
207211 resp_json = resp .json ()
208212 assert len (resp_json ["features" ]) == 0
You can’t perform that action at this time.
0 commit comments