Bug report #15512

Can't leave out minimum (x)or maximum scale for scale range in rule-based layer style (symbology or label)

Added by Raphael Das Gupta about 3 years ago. Updated about 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Unknown
Affected QGIS version:2.16.1 Regression?:No
Operating System:Ubuntu Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23436

Description

When creating a style that is intended to work at several map scales, it is useful to have a rule for a rule-based symbol or a rule-based label apply at all map scales below (more "zoomed out" than) a certain threshold but not to scales above (more "zoomed in" than) that threshold (and/or to have another rule apply at all map scales above (more "zoomed in" than) a certain threshold but not to scales below (more "zoomed out" than) that threshold). Apparently, this was possible in previous QGIS versions by enabling "scale range" for the rule in question, but leaving out minimum scale (x)or the maximum scale as appropriate to have the range be "open" towards the respective direction.

In QGIS 2.16.1 and 2.16.2 this does not seem to be possible anymore, or at least very fiddly.

To reproduce

  1. open QGIS
  2. create a new QGIS project (Ctrl-N or menu Project > New)
  3. create a scratch layer (menu Layer > Create Layer > New Temporary Scratch Layer... - keep "Geometry type and CRS" checked. Other options probably don't matter for this (I've used "Point" with "Selected CRS (EPSG:4326, WGS 84)"))
  4. open the "Layer Styling" panel (menu View > Panels > Layer Styling). Because the scratch layer created above is still the only layer in this project, it'll already be selected in the "Layer Styling" panel's top drop down.
  5. on the "Layer Styling" panel's "Symbology" tab, change the symbology type from "Single symbol" to "Rule-based"
  6. a default rule (converted from the previous auto-generated "Single symbol") will already be there. Let's edit it. (Select its entry in the rule list and click the page-with-pen button, or double click the entry in the rule list.)
  7. tick the "Scale range" checkbox
  8. delete the content of the "Maximum (inclusive)" input field
  9. let the input field lose focus (press the "Tab" key on your keyboard to move focus to the button to the right of the input field)

expected

  • The "Maximum (inclusive)" input field remains empty

observed

  • The previous value or a default value (re)appears in the "Maximum (inclusive)" input field

variations

  • perform the same for the "Minimum (exclusive)" instead of the "Maximum (inclusive)" input field
  • perform the same on the "Labels" tab (use "Rule-based labeling" in step 5, add a new rule using the + button)
  • perform the same on the "Labels" tab (use "Rule-based labeling" in step 5, add a new rule using the + button) but for the "Minimum (exclusive)" instead of the "Maximum (inclusive)" input field
  • do any of the above, but in step 4, use the context menu of the scratch layer's entry in the layers panel to open the layers "Properties" window and work on the "Style" or "Labels" tabs there instead of the "Layer Styling" panel

(very fiddly) workaround(s)

variant A: edit the rules list without going into edit mode

  1. Un-tick "Scale range"
  2. go back to the rule overview (< button)
  3. Select the rule row
  4. wait for a short moment (to avoid a double click)
  5. click into the "Min. scale" column of the row
  6. enter the value for the minimum scale (denominator only, i.e., only the part after the 1:)
  7. if "Live update" is not ticket, click "Apply"

variant B: scales greater than life-size

  1. in the "Maximum (inclusive)" field, enter a scale larger than 1:1, e.g. 4:1. It seems the denominator must be 1 for this to work. (4:3 won't do)
  2. go back to the rule overview (< button)
  3. if "Live update" is not ticket, click "Apply"

Gotcha for both variants: If you re-enter the rule editing mode, a default value is automatically inserted in the field. This makes them not really practical for any serious work, where you iteratively develop a symbol style or label style.

Associated revisions

Revision 9805782b
Added by Nyall Dawson over 2 years ago

Unifying rule based renderer scale API, fix scale related bugs

Fix #15512

History

#1 Updated by Raphael Das Gupta about 3 years ago

The conclusion that this was possible in earlier QGIS versions is from this (recent) GIS SE comment on my (also recent) question, this GIS SE answer on the same question and from the screenshots from this GIS SE question from back in 2012.

#2 Updated by Giovanni Manghi over 2 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by Nyall Dawson over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#4 Updated by Jürgen Fischer about 2 years ago

  • Category set to Unknown

Also available in: Atom PDF