Exporting and Importing Styles#

The layers in QGIS are saved separately from the settings and styles of a QGIS Project. This means that if you load the same layers into a different QGIS project, the symbology and styling of the data will be different. QGIS lets you save the symbology and styling of a layer as a separate file (.qml-files). Working with .qml-files saves you a lot of work and assures consistency between your maps.

A .qml-file saves the information of a particular layer. This includes the colours, outlines, shapes, labelling, as well as the Layer configuration, attribute table settings, and other options you have set for a layer in your QGIS project that are not related done to the data files themselves. You can choose whether to save only the colour symbology or any additional information.

You can export a style into the same folder as the data so your colleagues can apply the same styling when loading the data into QGIS. Some organisations may also use standardised symbols or colours in their maps.

For example, if you want to send a layer to your colleague with the same styling as you, it is best to check the “Layer properties”, “Symbology”, and “Labels” categories (and any additional styling options you have set). If you only wish to save a certain colouring, line thickness, or labeling style, you only need to check the respective boxes.

Saving or exporting styling settings#

  1. Open the styling panel and click on Styles. A dropdown menu will open with the option to export the layer styling.

  2. Since in this case, the styling is for exactly that dataset, you can leave all the boxes checked.

  3. Select a location and name for the styling. The styling will be saved as a .qml file. Make sure it is saved in the same folder as the dataset and give it the same name as the corresponding dataset. This way it will, when loading the data into QGIS, the styling will automatically be applied.

../../_images/en_30.30.2_save_layer_style_window.png

Fig. 114 Save Layer styling window in QGIS 30.30.2.#

When working with similar data (e.g. building types or flooding risk), it is useful to have template styles, that can be quickly loaded into your QGIS-project or saved in your Styling Template library.

Tip

When a styling is saved in the same location as the data and has the same name as the corresponding dataset, the styling will be automatically applied to the layer when loading the data into QGIS!

Loading a style into a QGIS-project#

  1. Open the style manager: Settings > Style manager

  2. Click on import/export and select import items

  3. Navigate to the folder where the style is saved and click import.

  4. The style should now be available as a preset in the styling panel.

Note

You can also import styles directly in the styling panel of a layer. But it will not be added to your style library unless you save it into your library.