# QGIS

# Install und Update

# Update QGIS-Version über login-script

Im login-Script läuft für Mitglieder der AD-Gruppe _gisuser das folgende Script:
- \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\tools\qgis3_update.bat
Das Script überprüft über die Filegrösse des Files C:\OSGeo4W64\apps\qgis-ltr\bin\qgis_core.dll ob die aktuelle Version installiert ist. Das Installationspaket der aktuellen Version befindet sich hier: \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\packages

Folgende Schritte sind auszuführen um das package zu aktualisieren (auf ws_gha2021):
- Verzeichnis \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\packages leeren (move in Ordner old) 
- lokales Verzeichnis auf WS_gha OSGeo4W64 temporär umbenennen zu OSGeo4W64_temp
- c:\util: alte setup-Dateien und Download-Verzeichnis entfernen
- \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\osgeo4w-setup\osgeo4w-setup.exe
    * Fortgeschritten/Download ohne install -> C:\util
- Daten im neuen kryptischen Verzeichnis nach \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\packages kopieren
- Anpassen batch-File P:\Wiss_IT\installer_qgis_3\qgis-install-from-local-package.bat (Versionen)
- ws_gha2021: P:\Wiss_IT\installer_qgis_3\qgis-install-from-local-package.bat ausführen
- Anpassen batch-Files P:\Wiss_IT\installer_qgis_3\installer_qgis_3\tools\qgis3_update.bat: version, Filegrösse qgis_core.dll
- \\\fs01\applikationen$\Wiss_IT\installer_qgis_3\tools\version.reg -> richtige Version rein schreiben (für NetKey-Installer)

Der NetKey-Installer führt ebenfalls das Script qgis-install-from-local-package.bat aus, ab diesem Zeitpunkt wird also auch über das NetKey die aktuelle Version verteilt

Die Citrix-Version muss ebenfalls aktualisiert werden (siehe Dokumentation IT-Betrieb)

# QGIS working with JSON Data

## Query Builder

Wenn man eine Where-Bedingung beim Query-Builder hinzufügt, werden nur die Daten in den QGIS-Layer geladen, wo man wirklich braucht.

Da sind unterschiedliche Syntax Möglichkeiten für die `where`-Bedingungen möglich.
z. B.
```sql
attribute_data->>'beh_hunting' = 'true'
```

oder 
```sql
attribute_data @> '{"beh_hunting":true}'
```


[![Screenshot 2024-09-30 at 12.11.16.png](https://wiki.vogelwarte.ch/uploads/images/gallery/2024-09/scaled-1680-/screenshot-2024-09-30-at-12-11-16.png)](https://wiki.vogelwarte.ch/uploads/images/gallery/2024-09/screenshot-2024-09-30-at-12-11-16.png)

## Advanced Filter in Attribute Table

In der Datentabelle kann man in JSON-Felder mit dem "Advanced Filter" arbeiten. Wichtig sind die einfachen Anführungszeichen für die "Key"-Wert.

```
map_get(attribute_data, 'beh_flying') = true
```

# QGIS Plugin Development

# Install Eric IDE Windows

Eric 7 Installation:

```
cd %USERPROFILE%
c:\Python39\python.exe -m venv eric_env
%USERPROFILE%\eric_env\Scripts\python.exe -m pip install --upgrade pip
%USERPROFILE%\eric_env\Scripts\python.exe -m pip install eric-ide
%USERPROFILE%\eric_env\Scripts\eric7_post_install.exe
```

Aus <https://eric-ide.python-projects.org/eric-download.html> 

Install PyQT5:
- PyPI -> install -> pyqt5 (eingeben)
- PyPI -> install -> PyQt5Designer (eingeben)


C:\Users\gha.VOGELWARTE\OneDrive - Vogelwarte\qgis\Qt Designer Setup.exe

[![](https://wiki.vogelwarte.ch/uploads/images/gallery/2026-01/scaled-1680-/image-1767784504448.png)](https://wiki.vogelwarte.ch/uploads/images/gallery/2026-01/image-1767784504448.png)

benötigte QGIS plugins:
- Plugin Reloader 


damit Plugin Reloader auf Entwicklungs-Daten zugreifem kann, muss vor dem Start von QGIS eine Systemvariable erstellt werden (C:\_daten\github\qgis_plugins ist das parent-Verzeichnis des lokalen Projektes):

- windows powershell: [Environment]::SetEnvironmentVariable("QGIS_PLUGINPATH","C:\_daten\github\qgis_plugins","User")

- Befehl damit QGIS wieder auf den Standard-Plugin-Pfad (im Benutzerprofil) verweist:
    * windows powershell: [Environment]::SetEnvironmentVariable("QGIS_PLUGINPATH",$null,"User")
    
metadata.txt: Versionsnummer anpassen

Deploy: siehe [Deploy Plugin VowaConservation](https://wiki.vogelwarte.ch/books/qgis/page/deploy-qgis-plugin-vowaconservation)

# Deploy QGIS Plugin VowaConservation

Im login script wird beim Anmelden das folgende batch-file ausgeführt:

P:\\Wiss\_IT\\installer\_qgis\_3\\tools\\vowa\_conservation\_plugin\_update.bat

Es vergleicht die Dateigrösse des files vowa\_conservation.py mit der Dateigrösse der neuen Version des Files. Wenn die Dateigrössen nicht übereinstimmen wird die das lokal installierte Plugin durch dasjenige auf dem Laufwerk P ersetzt.

Ordner P:\\Wiss\_IT\\installer\_qgis\_3 (user maintenance in diesem hat Schreibrechte, passwort in bitwarden):

- Entwicklungsumgebung 
    - metadata.txt anpassen: neue Versionsnummer
    - vowa\_conservation.py: neue Versionsnummer oberhalb class als comment ergänzen (damit das File eine andere Dateigrösse erhält -&gt; siehe unten)
    - VowaConservation-Folder zippen -&gt; VowaConservation.zip
- Folder VowaConservation verschieben nach P:\\Wiss\_IT\\installer\_qgis\_3\\old\\VowaConservation\_x\_x (x\_x: alte Versionsnummer)
- Folder VowaConservation von Entwicklungsumgebung nach P:\\Wiss\_IT\\installer\_qgis\_3 kopieren
- "P:\\Wiss\_IT\\installer\_qgis\_3\\tools\\vowa\_conservation\_plugin\_update.bat" editieren: 
    - variable outputfile anpassen (versionsnummer für log-file)
    - variable test anpassen: Grösse in bytes des files vowa\_conservation.py (2 Anpassungen im File)
- VowaConservation-Folder zippen -&gt; VowaConservation.zip

Ordner Z:\\SciData\\DOM\_Wis\_Sup\\UNIT\_GIS\\gisdata\\qgis\_plugins\_repo\_vowa:

- VowaConservation.zip ersetzen (zuerst Kopie der alten Version mit alter Versionsnummer ins Verzeichnis Z:\\SciData\\DOM\_Wis\_Sup\\UNIT\_GIS\\gisdata\\qgis\_plugins\_repo\_vowa\_saves kopieren)
- plugins.xml: Version anpassen

Test mit Windows-Ausleihnotebook (QGIS und alte Version des Plugins müssen auf dem Notebook installiert sein, allenfalls vorgängig alte Version des Plugins vor Test über zip der alten Version installieren)

# Providing QGIS-Plugins in Multiple Languages

If you want to provide a QGIS-plugin in more than one language follow the steps below. The plugin will then display in the language of QGIS. Users can alter the language of QGIS (Version 3.40) in:

Settings -&gt; Options -&gt; General -&gt; Override System Locale -&gt; User interface translation

[![image.png](https://wiki.vogelwarte.ch/uploads/images/gallery/2026-03/scaled-1680-/B2Zimage.png)](https://wiki.vogelwarte.ch/uploads/images/gallery/2026-03/B2Zimage.png)

As developer, you will perform the following steps:

##### 1. Mark text in UI and code as translatable

In Python code you mark a string by feeding it to the QGIS translator object:

> my\_string = QCoreApplication.translate(context: "context\_of\_this\_string", sourceText: "the string to be translated")

For strings in the UI you need to open the according .ui file in QT Designer (or Designer, the app's name may differ), select the element to be translated, and make sure that "translatable" is checked in the entry '**text**' of the category QLabel, QAbstractButton, or wherever you find this entry (depends of the UI item type).

##### 2. Create a folder "i18n"

If it doesn't exist already, create a folder "i18n" within your project folder.

##### 3. Translate .ui to .py files

If you have touched your .ui files then compile them into .py files with the command pyuic (pyuic5 or pyuic6).

> pyuic5 -o name\_of\_ui\_file.py name\_of\_ui\_file.ui

##### 4. Create a or update the .pro file listing all ui and code files that contain translatable text

Navigate into the i18n folder. There you need to create or – if it already exists – update a .pro file. It is a simple text file listing all other files that contain translatable text. It also specifies the translation files with .ts ending that will be generated next. A .pro file may look like this:

> FORMS = ui/my\_dialog.ui \\  
>  ui/another\_dialog.ui
> 
> SOURCES = my\_plugin.py \\  
>  my\_module.py \\  
>  another\_module.py
> 
> TRANSLATIONS = i18n/my\_plugin\_de.ts \\  
>  i18n/my\_plugin\_fr.ts \\  
>  i18n/my\_plugin\_it.ts \\  
>  i18n/my\_plugin\_en.ts

##### 5. Generate .ts files which list all translatable text

The command pylupdate (or pylupdate5 or pylupdate6) takes the .pro file as input and creates the specified .ts files, for instance:

> pylupdate5 my\_list\_of\_translatables.pro

##### 6. Translate text in the .ts files with Linguist

Open all .ts files with the app QT Linguist (or just Linguist). There, you make all translations. Don't forget to save the files before quitting the application.

##### 7. Compile the .ts files to .qm files

The command lrelease (or lrelease5 or lrelease6) will create .qm files from the .ts files. These are the files that the plugin will use for translation. Leave them in the i18n folder and make sure to include them in the plugin deployment.

> lrelease5 \*.ts

# QGIS Plugins Documentation

Documentation of all QGIS plugins developed and maintained in-house.

# Vowa Baselayers – Purpose, Installation, Usage

### Purpose of the QGIS Plugin

<span lang="EN-GB">There are a number of commonly used geodata available locally at the servers of Vogelwarte as well as online at swisstopo. Users of QGIS who want to use these data in their visualisations require specific knowledge of the data and database structure in order to find the appropriate layers.</span>

<span lang="EN-GB">It is the goal of this plugin to make overview, access, and use of the commonly used geodata as easy as possible. The plugin presents the data so that the users recognise what data are available. It allows selecting the data and adding the selected data to the user’s QGIS project. Furthermore, it gives descriptions about the layer and links to metadata.</span>

### Installation

In QGIS, go to "Plugins" and "Manage and Install Plugins...". Click on "All" and type "VoWa". You will see all available QGIS plugins created and maintained in-house. Make sure the required plugin has a checkmark next to it.

If the requested plugin does not show in "All" go to "Settings" and make sure that Plugin Repository "VoWa-Plugins 3" is listed. If it is not, contact the Scientific IT (see Contact below).

### Usage

Prerequisite: You need to have read access to the Spatial DB.

You open the plugin by either selecting "Plugins" &gt; "Vowa Baselayers" &gt; "Vowa Baselayers" from the menu, or by clicking on the plugin's icon in the toolbar. The plugin may ask for a master authentication password once. It then presents a dialog with a number of tabs. Each tab corresponds to a category of base layer maps and contains a list of various such map layers. You find descriptions and links to metadata for most layers.

Select the requested map layers by clicking on them. By holding Shift or Ctrl/Cmd while clicking you add more layers to or remove them from the selection. If you change to another tab the layers you already selected remain selected. Please, find an indication of the total number of layers you have selected in all tabs above the tabs.

The language of the plugin corresponds to the language of your QGIS. However, if you prefer to have the map layers displayed in a differing language click on the language buttons at the top right of the dialog. The same layers will appear with translated title and description. (If the description and metadata fields are presented as links, the link label will not be translated.)

If you have selected the required map layers click "Add" to add these layers to the current QGIS project. The layer name will correspond to the title field as shown in the map layer list. You may rename or otherwise manipulate the layers in QGIS. The dialog will remain open so that you can add more layers if required, even the same layers multiple times. You close the dialog with the according button at the bottom right.

### Implementation and Maintenance

The QGIS plugin uses tables in the schema qgis\_tools in our DPSpatial database for storing the information on the layers to be loaded into QGIS. The documentation is [on this page](https://wiki.vogelwarte.ch/books/schema-qgis-tools/page/tables-in-schema-qgis-tools "Tables in schema qgis_tools").

You find further information on the development and maintenance of the plugin and the layers it provides [on this page](https://wiki.vogelwarte.ch/books/qgis/page/vowa-baselayers-implementation-and-maintenance).

### Contact

GIS, maintenance data layers: [Jérôme Guélat](mailto:Jerome.Guelat@vogelwarte.ch)  
Scientific IT, implementation: [Bernhard Schneider](mailto:bernhard.schneider@vogelwarte.ch)

# VoWa Conservation

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

The plugin is configured so that all text is always displayed in German, independent of the language setting of QGIS. This is implemented by setting all translations – EN, FR, IT – to the German text. The non-German text can be found in the comment lines of the translations (see .ts files). (This implementation follows the requirement expressed by Gaby on Feb 16th, 2026.)

### Contact

# VoWa MAA

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

### Contact

# VoWa Synthese

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

### Contact

# VoWa Ornitho Import

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

### Contact

# VoWa Ringfilter Formular

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

### Contact

# VoWa Tmo Filter

### Purpose of the QGIS Plugin

### Installation

### Usage

### Implementation

### Contact

# Vowa Baselayers – Implementation and Maintenance

### Implementation

The QGIS plugin is implemented as standard QGIS plugin with Python. It uses tables in the schema qgis\_tools in the DPSpatial database for storing the information on the layers to be loaded into QGIS. The documentation on the tables of this schema is [on this page](https://wiki.vogelwarte.ch/books/schema-qgis-tools/page/tables-in-schema-qgis-tools "Tables in schema qgis_tools"). The QGIS plugin repository can be found [on the Vogelwarte GitLab](https://gitlab.vogelwarte.ch/scientific-it/qgis-plugins/QGIS-Plugin-basemap-perimeter).

Purpose, installation, and usage of the plugin are documented [on this page](https://wiki.vogelwarte.ch/books/qgis/page/vowa-baselayers-purpose-installation-usage).

### Layer Types

The following layer types can be provided through the QGIS plugin:

- WMS
- WMTS
- QGIS Layer File
- Shapefile
- GeoPackage
- GeoTIFF
- PostGIS Vector Layer

Each layer type requires a set of parameters so that it is loaded properly in QGIS. You find the specification [on this page](https://wiki.vogelwarte.ch/books/schema-qgis-tools/page/tables-in-schema-qgis-tools).

### Test Layers

In order to add layers in the table vowabaselayers that are only visible for development and test users you have to do the following:

1. Create the environment variable "VOWA\_BASELAYERS\_DEV=true" on your computer.
2. Add the layers and give them IDs greater than 1000.

### &amp;-Character in Tab Titles

The QGIS plugin replaces '&amp;' characters in tab titles by default with '\_'. If you want to use the '&amp;' character in tab titles type it twice. For instance, the tab title "Lakes &amp;&amp; Rivers" will be shown as "Lakes &amp; Rivers" in the QGIS plugin.