Bug report #14804
Freeze of QGIS by using a qml file
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22761|
Using the roads shapefile from:
For example a small one: andorra
And a qml file from:
Some time ago I was able to style the roads.shp
Now, QGIS freaks out (with me here on Debian, both master and 2.14) and freezes
Attached file contains both roads.shp as roads.qml so just opening this one would show my issue.
cpu-level rises, I see a lot of strange (grey) drawing artefacts and QGIS freezes..
#1 Updated by Nyall Dawson over 5 years ago
- Status changed from Open to Feedback
I think the issue is that the styles in that qml all use Map Units as sizes, but your shapefile is in lat/long so the map units are degrees. This means that you are drawing lines with a width of 2 degrees - that's huge! It results in all kinds of rendering artefacts and slowdowns like you're seeing here.
If you reproject the shapefile into a meters based CRS then things work as expected.
#2 Updated by Richard Duivenvoorde over 5 years ago
- Status changed from Feedback to Closed
Nyal, thanks for checking!
Ah, clear. Yes could have known/find that myself :-(
Anyway, should/could we check for this kind of anomalies?
Are there being done other checks when a qml (or other xml file) are loaded?
I can think of:
- are resources/symbols that are mentioned available
- is the xml valid (though we do not have schema's :-) )
I think it is safe to say that if a qml contains rules with map units and data is degrees it almost always will fail?
Maybe a more generic 'is it safe to try to load this file' piece of code?
Anyway, I'll close this one for now I think? I'll sent an email to the dev list, to check if there is a need for this.