Bug report #21281

Bug with multiple Else items in rule-based style

Added by Steve Lowman over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Symbology
Affected QGIS version:3.5(master) Regression?:Yes
Operating System:Any Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:29099

Description

Attached is a polygon shapefile plus three rule-based .qml stylesheet files, as follows:

test_polygons.shp

And, the rule-based stylesheets:

  1. Two sets of scale range rules with Else.qml
  2. One set of scale range rules with Else.qml
  3. Two sets of scale range rules with IS NULL OR IN expression.qml

In QGIS 2.18, all three styles behave correctly. You can identify and select all the features, and snap to and edit the vertices.

In QGIS 3.4, Style 1 (Two sets of scale range rules with Else.qml) reveals a bug, whereby for those features covered by the Else part of the rule expression, although you can edit their boundaries with the some of the digitising tools, you cannot do the following:

  • Identify them with the Identify Features tool
  • Select them with the Select Features tool
  • Snap to their vertices or segments with digitizing tools
  • Edit their vertices with the Vertex tool

This problem does not occur for the same features when either of the other two stylesheets (numbered 2 and 3 above) are applied. Therefore, I conclude that the problem is occurring only for features covered by the 'Else' part of a rule-based expression and only when the 'Else' item is present more than once in the list of rules. The problem is a regression in QGIS 3.4, because it does not occur in QGIS 2.18.

The repeating of the same items in the rule list allows us to control the width of borders for different scale ranges.

The same problem occurs for these features and styles in a geopackage, so it is not specific to shapefiles.

I have tested the issue only for polygons, so not sure if it would be the same for lines or points.

I selected "Symbology" for the category, although it also affects other categories. Perhaps it should be category "Expressions"?

QGIS 3 - Bug with multiple Else items in rule-based style.zip - One shapefile and three .qml files, as described in the report text. (117 KB) Steve Lowman, 2019-02-15 01:40 PM

History

#1 Updated by Steve Lowman over 5 years ago

I should have also noted that the problem never occurs for those features that are not covered by the 'Else' part of the expression.

#2 Updated by Alessandro Pasotti over 5 years ago

  • Assignee set to Alessandro Pasotti

#3 Updated by Alessandro Pasotti over 5 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Operating System changed from Windows 10 to Any
  • Priority changed from Normal to High
  • Status changed from Open to In Progress
  • Affected QGIS version changed from 3.4.4 to 3.5(master)
  • Resolution set to fixed/implemented

#4 Updated by Alessandro Pasotti over 5 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF