Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OARec: add autodiscovery link relation #1908

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion pygeoapi/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Colin Blackburn <[email protected]>
# Ricardo Garcia Silva <[email protected]>
#
# Copyright (c) 2024 Tom Kralidis
# Copyright (c) 2025 Tom Kralidis
# Copyright (c) 2022 Francesco Bartoli
# Copyright (c) 2022 John A Stevenson and Colin Blackburn
# Copyright (c) 2023 Ricardo Garcia Silva
Expand Down Expand Up @@ -1064,6 +1064,20 @@ def describe_collections(api: API, request: APIRequest,
'href': f'{api.get_collections_url()}/{k}?f={F_HTML}'
})

if collection_data_type == 'record':
collection['links'].append({
'type': FORMAT_TYPES[F_JSON],
'rel': 'http://www.opengis.net/def/rel/ogc/1.0/ogc-catalog',
'title': l10n.translate('Record catalogue as JSON', request.locale), # noqa
'href': f'{api.get_collections_url()}/{k}?f={F_JSON}'
})
collection['links'].append({
'type': FORMAT_TYPES[F_HTML],
'rel': 'http://www.opengis.net/def/rel/ogc/1.0/ogc-catalog',
'title': l10n.translate('Record catalogue as HTML', request.locale), # noqa
'href': f'{api.get_collections_url()}/{k}?f={F_HTML}'
})

if collection_data_type in ['feature', 'coverage', 'record']:
collection['links'].append({
'type': FORMAT_TYPES[F_JSON],
Expand Down