From fc2a1599ed578ce717afda1fbfdbd065be8c8725 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Wed, 13 Sep 2023 16:11:40 -0700 Subject: [PATCH] Add (but not enable) STAC plugin by default --- images/README.md | 8 ++++++++ images/qgis/Dockerfile | 3 +++ images/qgis/setup-qgis-plugins.bash | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100755 images/qgis/setup-qgis-plugins.bash diff --git a/images/README.md b/images/README.md index 7fcc129f..5841d2e5 100644 --- a/images/README.md +++ b/images/README.md @@ -49,6 +49,14 @@ additional tags: All the available tags can be found [here](https://quay.io/repository/jupyter-remote-desktop-proxy/qgis?tab=tags) +QGIS plugins that are deemed useful when working in the cloud are included +by default. This currently includes the following plugins: + +1. [QGIS STAC API browser](https://stac-utils.github.io/qgis-stac-plugin/) + +However, these are not _enabled_ by default. The user still has to go to the +plugins menu and enable them. + ## Policy for adding images To reduce maintenance burden, we will only accept maintaining images here that diff --git a/images/qgis/Dockerfile b/images/qgis/Dockerfile index d31cf64e..d98d8c18 100644 --- a/images/qgis/Dockerfile +++ b/images/qgis/Dockerfile @@ -4,5 +4,8 @@ FROM ${IMAGE_PREFIX}base:latest RUN mamba install -c conda-forge --yes \ qgis +COPY --chown=1000:1000 setup-qgis-plugins.bash /tmp/setup-qgis-plugins.bash +RUN /tmp/setup-qgis-plugins.bash && rm /tmp/setup-qgis-plugins.bash + COPY qgis.desktop ${DESKTOP_FILES_DIR}/qgis.desktop COPY qgis.xml ${MIME_FILES_DIR}/qgis.xml diff --git a/images/qgis/setup-qgis-plugins.bash b/images/qgis/setup-qgis-plugins.bash new file mode 100755 index 00000000..c2417664 --- /dev/null +++ b/images/qgis/setup-qgis-plugins.bash @@ -0,0 +1,19 @@ +#!/bin/bash +# Sets up various QGIS plugins that are useful when running +# on the cloud +set -euo pipefail + +# First, let's install the plugin manager +# Install from pip until https://github.com/conda-forge/staged-recipes/pull/23971 +# is merged and available from `conda-forge` +pip install --no-cache qgis-plugin-manager + +# Tell qgis-plugin-manager where our qgis plugins are +export QGIS_PLUGINPATH=/opt/conda/share/qgis/python/plugins + +# Initialize the qgis plugin manager +qgis-plugin-manager init +qgis-plugin-manager update + +# Install the STAC API Browser plugin: https://stac-utils.github.io/qgis-stac-plugin/ +qgis-plugin-manager install "STAC API Browser"