GeoProc.com
GeoProc.com

bcMultiStyles3: Load/Save .qml in multi-styled layer  bcMultiStyles3 logo
V1.0 - 13 June 2019

This QGIS V3.x Processing algorithm loads/saves multiple styles in qml's to/from a QGIS layer. The styles are saved as sidecars in the same directory of the layer file, by default. Loading styles can be done from the sidecars or from a directory.

Distributed under the GPL licence

This algorithm will NOT work on QGIS ≤ 2.99.
For QGIS ≥3.x


Contents


 

Installation

See here for installation instruction.

Note that in order to work correctly, this algorithm could require write rights to the directory the layer file resides in, because, by default, the .qml files are created as sidecars of the layer file.

Once successfully installed the algorithm is found in the Processing toolbox under GeoProc -> layers -> Multi-styles:

geoprocAlgos in Processing

Double-click "Multi-styles" to launch the configuration window.


 

Parameters

Five fields are presented:

  1. Input layer [required]: The layer to act on.
  2. Save [required]: Save all styles in different qml files. Default False implying a load operation.
  3. Force load [optional]: If True try to load all qml's from directory. If False, load layer qml's sidecars. No effect if Save is True.
  4. qml directory [required]: Directory to load/save qml's from/to.
  5. Output Result file [optional]: A HTML file showing the results of the operation. Leave empty to save to Layer source directory.

Styles are saved in qml's following this standard: layerName_styleName.qml
Where: layerName is the same name as the layer the qml relates to.
            styleName is the name of the style given in Style Manager.

If Save is True each layer's style is saved to its own qml.
If Save is False (default) qml's are read from files and added to the layer's Style Manager.
Then, if Force load is False, only sidecar qml's following the above naming convention are loaded. Otherwise all qml's in the directory are loaded, if possible.

NOTE
If one of the styles is named 's', then there is a problem! This is because the algorithm is created for geophysics workflows where the suffix '_s' is appended to sunshaded grid of product of the same name.


 

Results

On completion, a report file (html) is created listing the operation results. Click on the "File path" link from the Result Viewer to open the report. This report tells you if the processing has been successful or not for each qml processed.


 

Change log:

  • 1.0: First release.

 

Published date: 13 Jun 2019.