2

When my homebrewed style for road symbology and labeling is saved to a qml file, I am unable to load the labeling information from the qml file onto the same shapefile. This is the case for both the same map document and a new map document. The saved style loads but the labeling is blank. Here is a tar.gz with the roads shapefile, qml layer, and interstate symbol. Is this a bug or am I doing something wrong?

QGIS Info

QGIS version - 2.12.3-Lyon Compiled against Qt 4.8.6 - Running against Qt 4.8.6 Compiled against GDAL/OGR 1.10.1 - Running against GDAL/OGR 1.10.1 Compiled against GEOS 3.4.2-CAPI-1.8.2 - Running against GEOS 3.4.2-CAPI-1.8.2 r3921 PostgreSQL Client Version 9.4.4 SpatiaLite Version 4.1.1 QWT Version 6.0.0-svn PROJ.4 Version 480 QScintilla2 Version 2.8.4

  • 1
    Oops. Your QML doesn't work because you missed the .dbf out of the tarball so your roads don't have any attributes... – Spacedman Feb 19 '16 at 15:33
  • I can't get QML to restore labelling settings either, even though the settings are written to the QML file. I think it works if you save the layer as a Layer Definition File and reload it... Bug? Possibly... – Spacedman Feb 19 '16 at 15:43
  • The shapefile didn't have a dbf file to begin with... Ok so, I saved the shapefile as another shapefile, it made a dbf file to go with it but the label styles still fail to load on this new shapefile. – Valerie Anderson Feb 19 '16 at 15:43
  • Weird. The QML you bundled was clearly trying to do some styling based on attributes, it must have had one at some point! – Spacedman Feb 19 '16 at 15:45
  • You're right, @Spacedman! I saved the shapefile as a new shapefile, which added a dbf file. The qml was then able to load labeling information just fine. Thank you. – Valerie Anderson Feb 19 '16 at 15:49
3

It's a bug. Use the following workaround:

  • Open the layer properties dialog

  • Load the style

  • Cancel the dialog

https://hub.qgis.org/issues/13667

  • That works for me. Note the style doesn't change at first so you might not think its worked, I have to update the map window (drag, zoom) and the new style (with labels) appears. – Spacedman Feb 19 '16 at 15:49
  • This workaround worked the first 2 times I tried it. Now it no longer works. As of now, there is no reliable workaround for this bug. None. Zero. – Tim Brown Jul 2 '16 at 19:43
0

As far as I know copy and paste styles between different project files is the only workaround for this issue in QGIS 2.14.3. See also: http://hub.qgis.org/issues/14224

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.