From 6ac5cd9beeb92c0cb0644329a36f404abd442768 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sat, 8 Mar 2025 09:35:31 -0500 Subject: [PATCH] fix STAC Item provider output (#238) --- pygeometa/schemas/stac/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pygeometa/schemas/stac/__init__.py b/pygeometa/schemas/stac/__init__.py index 4a593de..fd9eaf4 100644 --- a/pygeometa/schemas/stac/__init__.py +++ b/pygeometa/schemas/stac/__init__.py @@ -106,7 +106,8 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]: }, 'properties': { 'title': title[0], - 'description': description[0] + 'description': description[0], + 'providers': [] }, 'links': [] } @@ -123,7 +124,9 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]: if 'revision' in mcf['identification']['dates']: stac_item['properties']['updated'] = mcf['identification']['dates']['revision'] # noqa - stac_item['properties']['providers'] = [{'name': mcf['contact']['pointOfContact']['organization']}] # noqa + for value in mcf['contact'].values(): + stac_item['properties']['providers'].append({ + 'name': value['organization']}) for value in mcf['distribution'].values(): title = get_charstring(value.get('title'), lang1, lang2)