Skip to content

Commit

Permalink
Drop split categorized layers functionality moved to qwc-qgis-server-…
Browse files Browse the repository at this point in the history
…plugins
  • Loading branch information
manisandro committed Feb 2, 2024
1 parent 05060c4 commit e0261a3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 201 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,11 @@ jobs:
echo "tag_latest=latest" >>$GITHUB_OUTPUT
fi
- name: Build and publish docker image without qgis
uses: elgohr/Publish-Docker-Github-Action@v5
if: github.event_name != 'pull_request'
with:
name: sourcepole/${{ github.event.repository.name }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
dockerfile: Dockerfile-noqgis
tags: "${{ steps.get_tag.outputs.tag }}-noqgis,${{ steps.get_tag.outputs.tag_latest }}-noqgis"

- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@v5
if: github.event_name != 'pull_request'
with:
name: sourcepole/${{ github.event.repository.name }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "${{ steps.get_tag.outputs.tag }},${{ steps.get_tag.outputs.tag_latest }}"
tags: "${{ steps.get_tag.outputs.tag }},${{ steps.get_tag.outputs.tag_latest }},${{ steps.get_tag.outputs.tag }}-noqgis,${{ steps.get_tag.outputs.tag_latest }}-noqgis"
22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
FROM sourcepole/qwc-uwsgi-base:ubuntu-v2024.01.16
FROM sourcepole/qwc-uwsgi-base:alpine-v2023.10.26

ADD requirements.txt /srv/qwc_service/requirements.txt

ARG DEBIAN_FRONTEND=noninteractive

# git: Required for pip with git repos
# libpq-dev g++ python3-dev: Required for psycopg2
# postgresql-dev g++ python3-dev: Required for psycopg2
RUN \
echo "deb http://qgis.org/ubuntu-ltr jammy main" > /etc/apt/sources.list.d/qgis.org-debian.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key D155B8E6A419C5BE && \
apt-get update && \
apt-get install -y libpq-dev g++ python3-dev && \
python3 -m pip install --no-cache-dir -r /srv/qwc_service/requirements.txt && \
apt-get purge -y libpq-dev g++ python3-dev && \
apt-get install -y python3-qgis && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
apk add --no-cache --virtual runtime-deps postgresql-libs && \
apk add --no-cache --virtual build-deps --update git postgresql-dev g++ python3-dev && \
pip3 install --no-cache-dir -r /srv/qwc_service/requirements.txt && \
apk del build-deps

ADD src /srv/qwc_service/
ADD schemas /srv/qwc_service/schemas

# This is needed because the qgis.core library is not capable of running in multiple threads
ENV UWSGI_THREADS=1

# download JSON schemas for QWC services
ENV JSON_SCHEMAS_PATH=/srv/qwc_service/schemas/
RUN python3 /srv/qwc_service/download_json_schemas.py
18 changes: 0 additions & 18 deletions Dockerfile-noqgis

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Activate virtual environment:

source .venv/bin/activate

Install requirements (*NOTE:* additionally requires modules from `python-qgis`):
Install requirements:

pip install -r requirements.txt

Expand Down
8 changes: 0 additions & 8 deletions schemas/qwc-config-generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@
"description": "Path for QGIS projects, which should be automatically detected. Must be a subdir qgis_projects_base_dir. Example: /data/scan",
"type": "string"
},
"qgis_projects_gen_base_dir": {
"description": "Path for generated QGIS projects, result of preprocessing. Must be a subdir of qgis_projects_base_dir. Can be the same as qgis_projects_scan_base_dir, in which case the theme autodetection will apply to generated QGIS projects. Example: /data/gen",
"type": "string"
},
"permissions_default_allow": {
"description": "Set whether resources are permitted or restricted by default. Example: true",
"type": "boolean"
Expand All @@ -111,10 +107,6 @@
"description": "Layer opacity values for QGIS <= 3.10",
"type": "object"
},
"split_categorized_layers": {
"description": "Set to true to activate the categorize groups functionality",
"type": "boolean"
},
"project_settings_read_timeout": {
"description": "Timeout for GetProjectSettings, GetCapabilities and DescribeFeatureType requests. Default: 60sec",
"type": "number"
Expand Down
112 changes: 0 additions & 112 deletions src/config_generator/categorize_groups_script.py

This file was deleted.

35 changes: 0 additions & 35 deletions src/config_generator/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,41 +639,6 @@ def preprocess_qgs_projects(self, generator_config, tenant):
qgs_projects_dir)
return

# Output directory for processed projects
qgis_projects_gen_base_dir = generator_config.get(
'qgis_projects_gen_base_dir')
if not qgis_projects_gen_base_dir:
self.logger.warning("Skipping preprocessing qgis projects in " +
qgs_projects_dir +
": qgis_projects_gen_base_dir is not set")
return

for dirpath, dirs, files in os.walk(qgs_projects_dir,
followlinks=True):
for filename in files:
if Path(filename).suffix == qgis_project_extension:
fname = os.path.join(dirpath, filename)
relpath = os.path.relpath(fname, qgs_projects_dir)
self.logger.info("Processing " + fname)

# convert project
dest_path = os.path.join(
qgis_projects_gen_base_dir, relpath)

if generator_config.get('split_categorized_layers', False) is True:
from .categorize_groups_script import split_categorized_layers
split_categorized_layers(fname, dest_path)
else:
copyfile(fname, dest_path)
if not os.path.exists(dest_path):
self.logger.warning(
"The project: " + dest_path +
" could not be generated.\n"
"Please check if needed permissions to create the"
" file are granted.")
continue
self.logger.info("Written to " + dest_path)

def search_qgs_projects(self, generator_config, themes_config):

qgis_projects_base_dir = generator_config.get(
Expand Down

0 comments on commit e0261a3

Please sign in to comment.