Les fichiers de projet

La notion de projets QGIS

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

Note

If the project you loaded has been modified in the meantime, by default, QGIS will ask you if you want to overwrite the changes. This behavior is controlled by the checkbox Prompt to save project and data source changes when required setting under Settings ‣ Options ‣ General menu.

You can load existing projects into QGIS using Project ‣ fileOpen Open…, Project ‣ New from template or Project ‣ Open Recent ‣.

At startup, a list of recently opened projects is displayed, including screenshots, names and file paths (for up to ten projects). This is a handy quick way to access recently used projects. Double-click an entry in this list to open the corresponding project. If you instead want to create a new project, just add any layer and the list disappears, giving way to the map canvas.

Si vous souhaitez revenir à une session vierge, aller sur Projet‣ fileNew Nouveau. Vous serez alors invité à enregistrer le projet existant si des modifications ont été apportées depuis son ouverture ou sa dernière sauvegarde.

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

Démarrer un nouveau projet dans QGIS

Les informations enregistrées dans un projet sont :

  • les couches ajoutées,

  • les couches qui peuvent être interrogées,

  • les propriétés des couches comprenant notamment les symboles associés et leurs styles,

  • la projection de la carte,

  • l’étendue de la dernière zone de visualisation,

  • les mises en page de cartes,

  • les éléments intégrés aux mises en page et leurs paramètres,

  • les options d’atlas,

  • les paramètres de numérisation,

  • les relations de tables,

  • les macros du projet,

  • les styles par défaut du projet,

  • les paramètres des extensions,

  • les paramètres de QGIS Server définis dans l’onglet QGIS Server des propriétés du projet,

  • les requêtes stockées dans le Gestionnaire de base de données.

The project file is saved in XML format. This means that it is possible to edit the file outside of QGIS if you know what you are doing. The file format has been updated several times compared with earlier QGIS versions. Project files from older QGIS versions may not work properly any more.

Note

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

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

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.

Note

A zipped project may be particularly useful with the Propriétés de stockage auxiliaire mechanism in order to embed the underlying database.

Les projets peuvent également être sauvegardés/chargés à partir d’une base de données PostgreSQL en utilisant le menu Projet :

  • Projet ‣ Ouvrir depuis

  • Projet ‣ Enregistrer sous …

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

Projects stored in PostgreSQL can be also loaded from the QGIS browser panel (the entries are located within the schema they are stored in), either by double-clicking them or by dragging them to the map canvas.

Générer des sorties depuis un projet

Il existe plusieurs façons de générer des sorties à partir de votre session QGIS. Nous avons déjà discuté de l’enregistrement en tant que fichier projet dans La notion de projets QGIS. D’autres façons de produire des fichiers de sortie sont :

  • Creating images: Project ‣ Import/Export ‣ saveMapAsImage Export Map to Image… opens a file dialog where you select the name, path and type of image (PNG, JPG and many other formats). This will also create a world file (with extension PNGW or JPGW) that is saved in the same folder as your image. This world file is used to georeference the image.

  • 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).

  • Exporting to PDF files: Project ‣ Import/Export ‣ Export Map to PDF… opens a dialog where you can define the part (Extent) of the map to be exported, the Scale, Resolution, Output width (pixels) and Output height (pixels). You can also choose to Draw active decorations and Draw annotations, as well as Rasterize map.

  • Designing print maps: Project ‣ newLayout New Print Layout… opens a dialog where you can layout and print the current map canvas (see section Mise en page des cartes).