27.3. Appendix C: QGIS File Formats

27.3.1. QGS/QGZ - The QGIS Project File Format

El formato QGS es un formato XML para el almacenamiento de proyectos QGIS. El formato QGZ es un archivo comprimido (zip) conteniendo un fichero QGS y un fichero QGD. El fichero QGD es una base de datos sqlite asociada del proyecto qgisque contiene datos auxiliares para el proyecto. Si no hay datos auxiliares, el fichero QGD estará vacío.

A QGIS file contains everything that is needed for storing a QGIS project, including:

  • project title

  • project CRS

  • the layer tree

  • snapping settings

  • relations

  • the map canvas extent

  • project models

  • leyenda

  • mapview docks (2D and 3D)

  • the layers with links to the underlying datasets (data sources) and other layer properties including extent, SRS, joins, styles, renderer, blend mode, opacity and more.

  • project properties

The figures below show the top level tags in a QGS file and the expanded ProjectLayers tag.


Figura 27.1 The top level tags in a QGS file


Figura 27.2 The expanded top level ProjectLayers tag of a QGS file

27.3.2. QLR - The QGIS Layer Definition file

A Layer Definition file (QLR) is an XML file that contains a pointer to the layer data source in addition to QGIS style information for the layer.

The use case for this file is simple: To have a single file for opening a data source and bringing in all the related style information. QLR files also allow you to mask the underlying datasource in an easy to open file.

An example of QLR usage is for opening MS SQL layers. Rather than having to go to the MS SQL connection dialog, connect, select, load and finally style, you can simply add a .qlr file that points to the correct MS SQL layer with all the necessary style included.

In the future a .qlr file may hold a reference to more than one layer.


Figura 27.3 The top level tags of a QLR file

27.3.3. QML - The QGIS Style File Format

QML is an XML format for storing layer styling.

A QML file contains all the information QGIS can handle for the rendering of feature geometries including symbol definitions, sizes and rotations, labelling, opacity and blend mode and more.

The figure below shows the top level tags of a QML file (with only renderer_v2 and its symbol tag expanded).


Figura 27.4 The top level tags of a QML file (only the renderer_v2 tag with its symbol tag is expanded)