{"id":28507386,"url":"https://github.com/opendatacube/datacube-ows","last_synced_at":"2026-02-10T00:05:15.066Z","repository":{"id":37682934,"uuid":"87350554","full_name":"opendatacube/datacube-ows","owner":"opendatacube","description":"Open Data Cube Open Web Services","archived":false,"fork":false,"pushed_at":"2025-06-27T05:12:40.000Z","size":19361,"stargazers_count":76,"open_issues_count":31,"forks_count":38,"subscribers_count":18,"default_branch":"develop","last_synced_at":"2025-06-27T06:21:57.183Z","etag":null,"topics":["flask","hacktoberfest","ogc-services","python"],"latest_commit_sha":null,"homepage":"https://datacube-ows.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opendatacube.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-05T19:52:30.000Z","updated_at":"2025-06-27T05:12:42.000Z","dependencies_parsed_at":"2023-02-13T01:31:37.783Z","dependency_job_id":"632e39ca-7d30-423f-9c78-f3e170b470f9","html_url":"https://github.com/opendatacube/datacube-ows","commit_stats":{"total_commits":2468,"total_committers":39,"mean_commits":"63.282051282051285","dds":0.5806320907617504,"last_synced_commit":"20e28f8e8d17e36d1c37c30fab72017b0b02984a"},"previous_names":[],"tags_count":120,"template":false,"template_full_name":null,"purl":"pkg:github/opendatacube/datacube-ows","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendatacube%2Fdatacube-ows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendatacube%2Fdatacube-ows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendatacube%2Fdatacube-ows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendatacube%2Fdatacube-ows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opendatacube","download_url":"https://codeload.github.com/opendatacube/datacube-ows/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendatacube%2Fdatacube-ows/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263696077,"owners_count":23497487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","hacktoberfest","ogc-services","python"],"created_at":"2025-06-08T20:30:58.829Z","updated_at":"2026-02-10T00:05:15.060Z","avatar_url":"https://github.com/opendatacube.png","language":"Python","funding_links":[],"categories":["Open Data Cube"],"sub_categories":["Testing your code"],"readme":"==========================\nDatacube Open Web Services\n==========================\n\n.. image:: https://github.com/opendatacube/datacube-ows/actions/workflows/lint.yml/badge.svg\n   :target: https://github.com/opendatacube/datacube-ows/actions/workflows/lint.yml\n\n.. image:: https://github.com/opendatacube/datacube-ows/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/opendatacube/datacube-ows/actions/workflows/test.yml\n\n.. image:: https://github.com/opendatacube/datacube-ows/actions/workflows/docker.yml/badge.svg\n   :target: https://github.com/opendatacube/datacube-ows/actions/workflows/docker.yml\n\n.. image:: https://github.com/opendatacube/datacube-ows/actions/workflows/scan.yml/badge.svg\n   :target: https://github.com/opendatacube/datacube-ows/actions/workflows/scan.yml\n\n.. image:: https://codecov.io/gh/opendatacube/datacube-ows/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/opendatacube/datacube-ows\n\n.. image:: https://img.shields.io/pypi/v/datacube?label=datacube\n   :alt: PyPI\n\n\nDatacube-OWS provides a way to serve data indexed in an Open Data Cube as visualisations, through\nopen web services (OGC WMS, WMTS and WCS).\n\n* Free software: Apache Software License 2.0\n* Documentation: https://datacube-ows.readthedocs.io.\n\nFeatures\n--------\n\n* Leverages the power of the Open Data Cube, including support for COGs on S3.\n* Fully supports WMS v1.3.0. Partial support (GetMap requests only) for v1.1.1.\n* Supports WMTS 1.0.0\n* Supports WCS versions 1.0.0, 2.0.0 and 2.1.0.\n* Richly featured styling engine for serving data visualisations via WMS and WMTS.\n\nSystem Architecture\n-------------------\n\n.. image:: docs/diagrams/ows_diagram1.9.png\n   :width: 700\n\nKnown CRS Limitations\n---------------------\n\n1. ODC datasets with WKT-format CRSs will not work with OWS - data from such datasets\n   will never be displayed. OWS currently only works with EPSG format CRSs.\n\n2. Datasets that straddle the anti-meridian or the north or south polar region will\n   cause issues with the legacy postgres driver.\n\nThese are fundamental limitation of the way OWS works with the postgres ODC index driver.\nThese limitations are addressed in v1.9.0, but only for the new ODC postgis index driver.\n\nNote for Developers\n-------------------\n\nThis repository is currently running the TypeChangeBot as part of an academic research project.  Developers making\nchanges to type hints will be prompted to fill out a short survey about the reasons for the annotation\nchanges. Participation is voluntary. More information about the project can be found\n`here \u003chttps://cse-rdyer-05.unl.edu/tcbot/\u003e`__\n\nCommunity\n---------\n\nThis project welcomes community participation.\n\n`Join the ODC Discord \u003chttps://discord.com/invite/4hhBQVas5U\u003e`__ if you need help\nsetting up or using this project, or the Open Data Cube more generally.\n\nPlease help us to keep the Open Data Cube community open and inclusive by\nreading and following our `Code of Conduct \u003ccode-of-conduct.md\u003e`__.\n\nSetup\n-----\n\nDatacube_ows (and datacube_core itself) has many complex dependencies on particular versions of\ngeospatial libraries. Dependency conflicts are almost unavoidable in environments that also contain\nother large complex geospatial software packages. We therefore strongly recommend some kind of\ncontainerised solution and we supply scripts for building appropriate Docker containers.\n\nLinting\n-------\n\n.. code-block::\n\n    ruff check\n    isort --check --diff **/*.py\n\n\nConfiguration and Environment\n-----------------------------\n\nThe configuration file format for OWS is `fully documented here \u003chttps://datacube-ows.readthedocs.io/en/latest/configuration.html\u003e`_.\n\nAnd example configuration file `datacube_ows/ows_cfg_example.py` is also provided, but\nmay not be as up-to-date as the formal documentation.\n\nEnvironment variables that directly or indirectly affect the running of OWS\nare `documented here \u003chttps://datacube-ows.readthedocs.io/en/latest/environment_variables.html\u003e`_.\n\nDocker-Compose\n--------------\n\nsetup env by export\n^^^^^^^^^^^^^^^^^^^\n\nWe use docker compose to make development and testing of the containerised ows images easier.\n\nSet up your environment by creating a `.env` file (see below).\n\nTo start OWS with flask connected to a pre-existing database on your local machine::\n\n  docker compose up\n\nThe first time you run docker-compose, you will need to add the `--build` option::\n\n  docker compose up --build\n\nTo start ows with a pre-indexed database::\n\n  docker compose -f docker-compose.yaml -f docker-compose.db.yaml up\n\nTo start ows with db and flask (development)::\n\n  docker compose -f docker-compose.yaml -f docker-compose.override.yaml -f docker-compose.db.yaml up\n\nTo start ows with db and gunicorn instead of flask (production)::\n\n  docker compose -f docker-compose.yaml -f docker-compose.db.yaml up\n\nThe default environment variables (in .env file) can be overriden by setting local environment variables::\n\n  # Enable pydev for pycharm (needs rebuild to install python libs)\n  # hot reload is not supported, so we need to set FLASK_DEV to production\n  export PYDEV_DEBUG=yes\n  export FLASK_DEV=production\n  docker compose -f docker-compose.yaml -f docker-compose.db.yaml up --build\n\nsetup env with .env file\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: console\n\n    cp .env_simple .env # for a single ows config file setup\n    cp .env_ows_root .env # for multi-file ows config with ows_root_cfg.py\n    docker compose up\n\nDocker\n------\n\nTo run the standard Docker image, create a docker volume containing your ows config files and use something like::\n\n  docker build --tag=name_of_built_container .\n\n  docker run --rm \\\n        -e DATACUBE_OWS_CFG=datacube_ows.config.test_cfg.ows_cfg   # Location of config object\n        -e AWS_NO_SIGN_REQUEST=yes                                 # Allowing access to AWS S3 buckets\n        -e AWS_DEFAULT_REGION=ap-southeast-2 \\                     # AWS Default Region (supply even if NOT accessing files on S3! See Issue #151)\n        -e SENTRY_DSN=https://key@sentry.local/projid \\            # Key for Sentry logging (optional)\n        \\ # Database connection URL: postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chostname\u003e:\u003cport\u003e/\u003cdatabase\u003e\n        -e ODC_DEFAULT_DB_URL=postgresql://myuser:mypassword@172.17.0.1:35434/mydb \\\n        -e PYTHONPATH=/code                                        # The default PATH is under env, change this to target /code\n        -p 8080:8000 \\                                             # Publish the gunicorn port (8000) on the Docker\n        \\                                                          # container at port 8008 on the host machine.\n        --mount source=test_cfg,target=/code/datacube_ows/config \\ # Mount the docker volume where the config lives\n        name_of_built_container\n\nThe image is based on the standard ODC container and an external database\n\nInstallation with Conda\n-----------------------\n\nThe following instructions are for installing on a clean Linux system.\n\n* Create and activate a Python 3.10 Conda environment::\n\n    conda create -n ows -c conda-forge python=3.10 datacube pre_commit postgis\n    conda activate ows\n\n* Install the latest release using pip install::\n\n    pip install datacube-ows[all]\n\n* Initialise and run PostgreSQL::\n\n    pgdata=$(pwd)/.dbdata\n    initdb -D ${pgdata} --auth-host=md5 --encoding=UTF8 --username=ubuntu\n    pg_ctl -D ${pgdata} -l \"${pgdata}/pg.log\" start # if this step fails, check log in ${pgdata}/pg.log\n\n    createdb ows -U ubuntu\n\n* Enable the PostGIS extension::\n\n    psql -d ows\n    create extension postgis;\n    \\q\n\n* Initialise the Datacube and OWS schemas::\n\n    export ODC_DEFAULT_DB_URL=postgresql:///ows\n    datacube system init\n\n    # to create schema, tables and materialised views used by datacube-ows.\n\n    export DATACUBE_OWS_CFG=datacube_ows.ows_cfg_example.ows_cfg\n    datacube-ows-update ubuntu --schema\n\n    # If you are not using the `default` ODC environment, you can specify the environment to create the schema in:\n\n    datacube-ows-update -E myenv --write-role ubuntu --schema\n\n\n* Create a configuration file for your service, and all data products you wish to publish in\n  it.\n  `Detailed documentation of the configuration format can be found here. \u003chttps://datacube-ows.readthedocs.io/en/latest/configuration.html\u003e`_\n\n* Set environment variables as required.\n  Environment variables that directly or indirectly affect the running of OWS\n  are `documented here \u003chttps://datacube-ows.readthedocs.io/en/latest/environment_variables.html\u003e`_.\n\n\n* Run ``datacube-ows-update`` (in the Datacube virtual environment).\n\n* When additional datasets are added to the datacube, the following steps will need to be run::\n\n    # Update the materialised views (postgis index driver only - can be skipped for the postgis index driver):\n    datacube-ows-update --views\n    # Update the range tables (both index drivers)\n    datacube-ows-update\n\n* If you are accessing data on AWS S3 and running `datacube_ows` on Ubuntu you may encounter errors with ``GetMap``\n  similar to:\n  ``Unexpected server error: '/vsis3/bucket/path/image.tif' not recognized as a supported file format.``.\n  If this occurs run the following commands::\n\n    mkdir -p /etc/pki/tls/certs\n    ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt\n\n* Launch the flask app using your favorite WSGI server. We recommend using Gunicorn with\n  either Nginx or a load balancer.\n\nThe following approaches have also been tested:\n\nFlask Dev Server\n----------------\n\n* Good for initial dev work and testing.  Not (remotely) suitable for production\n  deployments.\n\n* `cd` to the directory containing this README file.\n\n* Set the `FLASK_APP` environment variable::\n\n        export FLASK_APP=datacube_ows/ogc.py\n\n* Run the Flask dev server::\n\n        flask run\n\n* If you want the dev server to listen to external requests (i.e. requests\n  from other computers), use the `--host` option::\n\n        flask run --host=0.0.0.0\n\nLocal Postgres database\n-----------------------\n\n1. create an empty database and db_user\n2. run `datacube system init` after creating a datacube config file\n3. A product added to your datacube `datacube product add url` some examples are here: https://github.com/GeoscienceAustralia/dea-config/tree/master/products\n4. Index datasets into your product for example refer to https://datacube-ows.readthedocs.io/en/latest/usage.html\n\n    ::\n\n      aws s3 ls s3://deafrica-data/jaxa/alos_palsar_mosaic/2017/ --recursive \\\n      | grep yaml | awk '{print $4}' \\\n      | xargs -n1 -I {} datacube dataset add s3://deafrica-data/{}\n\n5. Write an ows config file to identify the products you want available in ows, see example here: https://github.com/opendatacube/datacube-ows/blob/master/datacube_ows/ows_cfg_example.py\n6. Run ``datacube-ows-update --schema --read-role \u003cdb_read_role\u003e --write-role \u003cdb_write_role\u003e`` as a database\n   superuser role to create ows specific tables and views\n7. Run ``datacube-ows-update`` as ``db_write_role`` to populate ows extent tables.\n\nApache2 mod_wsgi\n----------------\n\nGetting things working with Apache2 mod_wsgi is not trivial and probably not the best\napproach in most circumstances, but it may make sense for you.\n\nIf you use the ``pip install`` approach described above, your OS's\npre-packaged python3 apache2-mod-wsgi package should suffice.\n\n* Activate the wsgi module:\n\n::\n\n  cd /etc/apache2/mods-enabled\n  ln -s ../mods-available/wsgi.load .\n  ln -s ../mods-available/wsgi.conf .\n\n* Add the following to your Apache config (inside the\n  appropriate `VirtualHost` section):\n\n  ::\n\n        WSGIDaemonProcess datacube_ows processes=20 threads=1 user=uuu group=ggg maximum-requests=10000\n        WSGIScriptAlias /datacube_ows /path/to/source_code/datacube-ows/datacube_ows/wsgi.py\n        \u003cLocation /datacube_ows\u003e\n                WSGIProcessGroup datacube_ows\n        \u003c/Location\u003e\n        \u003cDirectory /path/to/source_code/datacube-ows/datacube_ows\u003e\n                \u003cFiles wsgi.py\u003e\n                        AllowOverride None\n                        Require all granted\n                \u003c/Files\u003e\n        \u003c/Directory\u003e\n\n  Note that `uuu` and `ggg` above are the user and group of the owner of the Conda virtual environment.\n\n* Copy `datacube_ows/wsgi.py` to `datacube_odc/local_wsgi.py` and edit to suit your system.\n\n* Update the url in the configuration\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendatacube%2Fdatacube-ows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopendatacube%2Fdatacube-ows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendatacube%2Fdatacube-ows/lists"}