Saving Layer Style Files in QGIS

Sometimes getting a layer to be displayed precisely how you want it can be a tedious process in QGIS. Fortunately, there is a way to save that style so you can apply it to the same layer in another project, or to another layer with similar attributes.

Most of the time I use layer style files it’s for continuous data or rule-based formatting. This example is from the ColorBrewer example I showed last month, and is a very simple style. But, saving the layer style is the same process no matter how simple or complex the style is.

Once you’re in Properties/Style menu for the layer you want to save the style of, go to the “Style” drop down menu at the very bottom of the window. From there select “Save Style.” I usually save my styles as QGIS Layer Style Files. This will open a pop up for you to name your file and save it to the place your current project file is saved, but you can also save it elsewhere if needed. Style files use the extension .qml.

Once your style project is saved, you can apply it to other layers by opening their properties and using the “Style” drop down menu to load the previously saved file. Note that it will only work if the column names match between the layers.

I have a few different styles I keep handy when I work in QGIS. One is just a nice transparent white to warm red gradient that covers the range of probabilities we see often for honey bee foraging. Another is a red/yellow/green style that classifies soil test results into below, within, or above the phosphorous maintenance range. Keeping these .qml files helps me save time when I want to make matching maps across multiple sites. Do you have favorite applications for saved style files?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s