From 3adfdb2341fe70e790011dfe3bdc9de63e777820 Mon Sep 17 00:00:00 2001 From: Benjamin Webb <40066515+webb-ben@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:25:23 -0400 Subject: [PATCH] Describe required collection level metadata about EDR Queries (#1744) * Add data_queries to describe EDR Queries * Fix flake8 * Use covjson media type * Update pygeoapi-config-0.x.yml Update schema definition to match https://schemas.opengis.net/ogcapi/edr/1.1/openapi/schemas/collections/extent.yaml * Add data_queries to describe EDR Queries * Fix flake8 * Use covjson media type * Update pygeoapi-config-0.x.yml Update schema definition to match https://schemas.opengis.net/ogcapi/edr/1.1/openapi/schemas/collections/extent.yaml * Enable query type registration * Update base_edr.py * Add GeoJSON as a valid response type * Preserve query_types as list * Revert changes to min required by EDR spec --- pygeoapi/api/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pygeoapi/api/__init__.py b/pygeoapi/api/__init__.py index 793b596..65d8558 100644 --- a/pygeoapi/api/__init__.py +++ b/pygeoapi/api/__init__.py @@ -1209,6 +1209,7 @@ class API: if edr: # TODO: translate LOGGER.debug('Adding EDR links') + collection['data_queries'] = {} parameters = p.get_fields() if parameters: collection['parameter_names'] = {} @@ -1229,6 +1230,14 @@ class API: } for qt in p.get_query_types(): + data_query = { + 'link': { + 'href': f'{self.get_collections_url()}/{k}/{qt}', + 'rel': 'data' + } + } + collection['data_queries'][qt] = data_query + title1 = l10n.translate('query for this collection as JSON', request.locale) # noqa title1 = f'{qt} {title1}' title2 = l10n.translate('query for this collection as HTML', request.locale) # noqa