10

What is the difference between Layer Definition File (qlr) and QGIS Layer Style File (qml)? Which one is recommended?

I have only used qlr so far. It seems store all the data displayed in the "properties" of the layer.

TomazicM
  • 25,601
  • 22
  • 29
  • 39
Ken T
  • 438
  • 3
  • 11

1 Answers1

14

This question is answered in a blog post by Nathan Woodrow: What are all these QGIS file types? Why do I need them

Here's a summary:

  • The QML file (.qml) contains style information

  • The Layer Definition file (.qlr) contains a layer source pointer + style information

So you can drag a QLR file into a project, and it adds the layer with all its saved styling.

A QML file isn't tied to any specific data source.

csk
  • 24,827
  • 3
  • 32
  • 70
  • The link to Nathan Woodrow is broken, so here is a link to the docs: https://docs.qgis.org/3.4/en/docs/user_manual/appendices/qgis_file_formats.html – jabellcu Nov 19 '20 at 10:25
  • Link to the old blog post https://woostuff.wordpress.com/2014/03/22/all-the-q-files/ if you need to read the other posts there are located in that space as they haven't been migrated to his new site – Antonio Locandro Mar 04 '21 at 17:56