From ba7d3ba7d20d77bb98c71759fc97340d8f803d8d Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 24 Nov 2021 07:30:57 -0500 Subject: [PATCH] optimize collections handling (#822) --- pygeoapi/api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pygeoapi/api.py b/pygeoapi/api.py index 25eb2a3..8c16ce7 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -797,8 +797,15 @@ class API: return self.get_exception( 404, headers, request.format, 'NotFound', msg) + if dataset is not None: + collections_dict = { + k: v for k, v in collections.items() if k == dataset + } + else: + collections_dict = collections + LOGGER.debug('Creating collections') - for k, v in collections.items(): + for k, v in collections_dict.items(): collection_data = get_provider_default(v['providers']) collection_data_type = collection_data['type']