[GIS] Importing QML styles into QGIS

qmlstyle

I have spent the day attempting this to no avail…I am a bit of a newbie to QGIS, but please help!

I am trying to import the files at the bottom of: https://www.fscbiodiversity.uk/?q=QGISHabitatStyles

I am running 2.18 Las Palmas

They are all QML files – in QGIS I have created a new layer > properties, and want to match the new polygon with one of the styles. I have tried using the Style > load style process to no avail – the polygon changes to a style and refuses to match the style required.

Basically – how do I get all of the above styles to use as a palette (that opens every time) in QGIS?

Best Answer

I think your problem is understanding that a QML file is a style only for a specific dataset (or related dataset with the same structure) and not a file that provide you with a palette or a set of symbol that you can reuse for any data.

For exemple you may have a QML that will symbolise road based on a specific attribute, this is useful if your road data are separated in different file for different region as you could use the same QML to get the same symbology on all your road data.


If you want to use a QML on another kind dataset you will need to made sure that :

  • both dataset are of the same geometry type.
  • the attribute used for classification exist and is filled with the correct value.

In your case you will need to have a 'stylecode' column as stated in :

The QML file expects this attribute to be called 'stylecode'

and you need to fill each attribute of this column by the correct value, one of them beeing 'FDC' as stated in

for example, Ben's 'Fen-dominated communites' gets the abbreviation 'FDC'. These abbreviations must be recorded in an attribute in your shapefile in order to use the QML file