Skip to content

Commit 293e334

Browse files
author
Tik
committed
- collection search changed to use in to match collection id
1 parent 517809a commit 293e334

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pygeoapi/api/stac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _recursiveSearchCollections(request, result):
289289
root_result = [[r] for r in root_result if (r['rel'] == 'child')]
290290
stac_collections = list(map(_recursiveSearchCollections, repeat(request), root_result))
291291
stac_collections = list(chain(*stac_collections))
292-
contents = [c for c in stac_collections if (c['id'] == dataset)] if (dataset is not None) else stac_collections
292+
contents = [c for c in stac_collections if (dataset in c['id'])] if (dataset is not None) else stac_collections
293293
# get individual collection stac json
294294
# if dataset not in stac_collections:
295295
# msg = 'Collection not found'
@@ -405,6 +405,9 @@ def _recursiveCollections(api, request, path):
405405
if (collect.get('collections') is None):
406406
children += ['collections/' + l['href'].split('/')[-1] for l in collect['links'] if (l.get('entry:type') == 'Collection')]
407407
tmp += [collect] if (len(children) == 0) else []
408+
else:
409+
for t in collect['collections']:
410+
children += ['collections/' + l['href'].split('/')[-1] for l in t['links'] if (l.get('entry:type') == 'Collection')]
408411
for c in children:
409412
tmp += _recursiveCollections(api, request, c)
410413
queries['collections'] = tmp

0 commit comments

Comments
 (0)