Bug report #21273
Polygon layer snapping and vertex tool fail with rule-based style
|Affected QGIS version:||3.4.4||Regression?:||Yes|
|Operating System:||Windows 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29091|
I attach a geopackage containing one multipolygon layer, which has three features. The layer has two quite similar rule-based styles, where the symbology is determined by a field called "Land_Type" includes minimum and maximum scales for different widths of border. A third style has just a plain single fill symbology.
In QGIS 3.4, with the rule-based styles, when you make the layer editable and try to amend the features, the digitizing tools fail to snap to the vertices, and the vertex tool fails to pick up the vertices. The vertex tool will select vertices with a marquee drag, but it will not move them. If you load the simple-fill style, then the tools all work with no problem. Load either of the rule-based styles again, and the problem returns.
I tried converting the layer into a shapefile, pasting the rule-based style into it, and there was exactly the same problem, so it is not a Geopackage issue. It seems to be that something in the rule-based style is preventing the editing tools from working properly.
I saved one of the rule-based styles into a .qml with the shapefile, then I added it with this as the default style the map canvas in QGIS 2.18, and the snapping and node tool all worked with no problems, so it is definitely a QGIS 3 issue, and therefore, I have selected "Yes" to Regression in the options below.
(I have set the bug Category to "Unknown", because I do not know whether it should be under "Digitizing" or "Symbology")
#1 Updated by Steve Lowman over 1 year ago
- File two sets of values - no min max at all.qml added
- File only one set of values - min max scale range.qml added
The problem does not occur with a rule-based style that has only one instance of each of the values. So, it seems to be something to do with the fact that there are two mentions of each field value in the rule. I tried removing all the scale dependencies from all of the rules, but the issue was still occurring then.
I attach now two .qml files:
- only one set of values - min max scale range.qml
- two sets of values - no min max at all.qml
With style 1, there is only one set of values. They include a scale range. There is no editing problem.
With style 2, there are two sets of values (values are duplicated), and no scale-range. The problem is occurring with this style applied.
Therefore, it seems that the problem occurs only when the field values are duplicated in the set of rules.