6. Arbeiten mit Projektdateien

6.1. Vorstellung von QGIS-Projekten

The state of your QGIS session is called a project. QGIS works on one project at a time. A settings can be project-specific or an application-wide default for new projects (see section Optionen). QGIS can save the state of your workspace into a QGIS project file using the menu options Project ► fileSave Save or Project ► fileSaveAs Save As….

Bemerkung

If the project has been modified the * symbol will appear in the title bar and QGIS will, by default, ask you if you would like to save the changes. This behavior is controlled by the checkbox Prompt to save project and data source changes when required setting under Settings ► Options ► General.

You can load existing projects into QGIS from the Browser panel or by through Project ► fileOpen Open…, Project ► New from template or Project ► Open Recent ►.

At startup, a list of Project Templates and Recent Projects are displayed, including screenshots, names and file paths (for up to ten projects). The Recent Projects list is handy to access recently used projects. Double-click an entry to open the project or project template. You can also add a layer to create a new project automatically. The lists will then disappear, giving way to the map canvas.

Wenn Sie Ihre Sitzung löschen und neu beginnen möchten, gehen Sie zu :menuselection: Projekt –> fileNew :menuselection: Neu. Dabei werden Sie aufgefordert, das bestehende Projekt zu speichern, wenn seit dem Öffnen oder letzten Speichern Änderungen vorgenommen wurden.

When you open a fresh project, the title bar will show Untitled Project until you save it.

../../../_images/new_project.png

Abb. 6.1 Start eines neuen Projekts in QGIS

In einer Projektdatei sind folgenden Informationen gespeichert:

  • Hinzugefügte Layer

  • Welche Layer können abgefragt werden

  • Layereigenschaften, inklusive Symbologie und Styles

  • Projektion für das Kartenfenster

  • Zuletzt gewählte Ausdehnung im Kartenfenster

  • Drucklayouts

  • Drucklayout Elemente mit Einstellungen

  • Drucklayouts Atlas Einstellungen

  • Digitalisierungseinstellungen

  • Tabellen Beziehungen

  • Projekt Makros

  • Projekt Vorgabestile

  • Plugin-Einstellungen

  • QGIS-Servereinstellungen aus der Registerkarte QGIS-Server in den Projekteigenschaften.

  • Im DB-Manager gespeicherte Abfragen

The project file is saved in XML format (see QGS/QGZ - Das QGIS-Projekt-Dateiformat). This means that it is possible to edit the file outside of QGIS if you know what you are doing. The project file format has been updated several times. Project files from older QGIS versions may not work properly any more.

Bemerkung

By default, QGIS will warn you of version differences. This behavior is controlled in the General tab of Settings ► Options (checkbox Warn when opening a project file saved with an older version of QGIS).

Whenever you save a .qgs project file in QGIS, a backup of the file is created in the same directory as the project file, with the extension .qgs~.

The extension for QGIS projects is .qgs but when saving from QGIS, the default is to save using a compressed format with the .qgz extension. The .qgs file is embedded in the .qgz file (a zip archive), together with its associated sqlite database (.qgd) for auxiliary data. You can get to these files by unzipping the .qgz file.

Bemerkung

The Auxiliary Storage Properties mechanism makes a zipped project particularly useful, since it embeds auxiliary data.

Projekte können auch über die folgenden Menüeinträge des Projekts in eine PostgreSQL-Datenbank gespeichert bzw. geladen werden:

  • Projekt ► Öffnen aus

  • Projekt ► Speichern als

Both menu items have a sub-menu with a list of extra project storage implementations (PostgreSQL and GeoPackage). Clicking the action will open a dialog to pick a GeoPackage connection and project or a PostgreSQL connection, schema and project.

Projects stored in Geopackage or PostgreSQL can also be loaded through the QGIS browser panel, either by double-clicking them or by dragging them to the map canvas.

6.2. Handling broken file paths

When opening a project, QGIS may fail to reach some data sources due to unavailable service/database, or to a renamed or moved file. QGIS then opens the Handle Unavailable Layers dialog, referencing the unfound layers. You can:

  • Double-click in the Datasource field, adjust the path of each layer and click Apply changes;

  • Select a row, press Browse to indicate the correct location and click Apply changes;

  • Press Auto-Find to browse the folders and try to automatically fix all or selected broken path(s). Be aware that the browsing may take some time.

  • Ignore the message and open your project with the broken path(s) by clicking Keep Unavailable Layers. Your layer is then displayed in the Layers panel, but without any data until you fix the path using the indicatorBadLayer Unavailable layer! icon next to it in the Layers panel, or Repair Data Source… in the layer contextual menu.

    With the Repair Data Source… tool, once a layer path has been fixed, QGIS scans through all other broken paths and tries to auto-fix those that have the same broken file path.

  • deleteSelected Remove Unavailable Layers from the project.

6.3. Ausgaben erzeugen

Es gibt mehrere Möglichkeiten, um Ausgaben aus Ihrer QGIS-Sitzung zu erzeugen. Wir haben das Speichern als Projektdatei bereits in Vorstellung von QGIS-Projekten besprochen. Andere Möglichkeiten, Ausgabedateien zu erzeugen, sind:

  • Creating images: Project ► Import/Export ► saveMapAsImage Export Map to Image… outputs the map canvas rendering to an image format (PNG, JPG, TIFF…) at custom scale, resolution, size, … Georeferencing the image is possible. See Exporting the map view for more details.

  • Exporting to PDF files: Project ► Import/Export ► Export Map to PDF… outputs the map canvas rendering to PDF at custom scale, resolution, and with some advanced settings (simplification, georeferencing, …). See Exporting the map view for more details.

  • Exporting to DXF files: Project ► Import/Export ► Export Project to DXF… opens a dialog where you can define the ‚Symbology mode‘, the ‚Symbology scale‘ and vector layers you want to export to DXF. Through the ‚Symbology mode‘, symbols from the original QGIS Symbology can be exported with high fidelity (see section Creating new DXF files).

  • Designing maps: Project ► newLayout New Print Layout… opens a dialog where you can layout and print the current map canvas (see section Kartenlayout).