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

Version and top level folder #1036

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ jobs:
with:
directory: ./artifacts/
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11 changes: 8 additions & 3 deletions datacube_ows/ows_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,14 +1385,19 @@ def parse_layers(self, cfg):
self.product_index = {}
self.declare_unready("native_product_index")
self.root_layer_folder = OWSFolder({
"title": "Root Folder (hidden)",
"label": "ows_root_hidden",
"title": self.title,
"abstract": self.abstract,
"label": "ows_root",
"layers": cfg
}, global_cfg=self, parent_layer=None)

@property
def layers(self):
return self.root_layer_folder.child_layers
# Multiple top-level are not consistent with a strict reading of the OWS standard.
# If we have multiple top-level folders, wrap them in an auto-generated top-level folder.
if len(self.root_layer_folder.child_layers) == 1:
return self.root_layer_folder.child_layers
return [self.root_layer_folder]

def alias_bboxes(self, bboxes):
out = {}
Expand Down
7 changes: 7 additions & 0 deletions datacube_ows/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@
# The location of the datcube config file.
os.environ.setdefault("DATACUBE_CONFIG_PATH", "/opt/odc/.datacube.conf.local")

from datacube_ows import __version__

from datacube_ows.ogc import app # isort:skip

application = app


def main():
if "--version" in sys.argv:
print("Open Data Cube Open Web Services (datacube-ows) version",
__version__
)
exit(0)
app.run()


Expand Down
9 changes: 9 additions & 0 deletions docs/cfg_layers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ at least one named layer (defined below).

The "layers" section is a list of Layer configurations.

> Note: Although many WMS clients support multiple
> top-level layers, a strict reading of the WMS standard requires
> only one. Some WMS clients do not recognise all top level
> layers if more than one is defined.
>
> Therefore, in the interests of WMS standards compliance, if you define multiple top
> level layers, they will be automatically wrapped in a single top-level folder
> using the global metadata.

A layer may be either:

* A `named layer <#named-layers>`_ which represents a queryable
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/cfg/translations/de/LC_MESSAGES/ows_cfg.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Open web-services for the Open Data Cube "
"2022-03-24T23:29:57.407805\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2022-08-26 13:23+1000\n"
"POT-Creation-Date: 2024-07-18 10:48+1000\n"
"PO-Revision-Date: 2022-03-24 23:33+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
"Generated-By: Babel 2.15.0\n"

msgid "global.title"
msgstr "This is the German translation of the title"
Expand Down
Binary file modified integration_tests/cfg/translations/en/LC_MESSAGES/ows_cfg.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions integration_tests/cfg/translations/en/LC_MESSAGES/ows_cfg.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Over-ridden: aardvark 2022-03-24T23:29:57.407805\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2022-10-18 13:28+1100\n"
"POT-Creation-Date: 2024-07-18 10:48+1000\n"
"PO-Revision-Date: 2022-03-24 23:33+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
Expand All @@ -15,7 +15,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
"Generated-By: Babel 2.15.0\n"

msgid "global.title"
msgstr "Open web-services for the Open Data Cube"
Expand Down
Loading