Bug report #20567

Overriding symbols with expressions produces strange scale-related issues

Added by Matthew Baker over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:3.4.0 Regression?:No
Operating System:Windows, Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:28387

Description

I'm trying to override symbol outlines and even symbol types based on expressions.

There are a few ways to get to these issues, so I'll try to describe them.

Case 1:

- Given a field of INT type, if the value is 999, set the symbol outline to 1 and set the color to #FF0000

At first glance, the override works, but some points are showing the red outline when they shouldn't (incorrect rendering) - but when you zoom in, the red outline disappears to show the correct rendering.

Expression example for STROKE COLOR expression:

case when "projected_school_id" = '999' then '#FF0000' end

Case 2:

- Given a field of INT type, as above, in the expression for symbol type (not labeled, but where the symbol is defined as a circle, square, triangle, etc.), use a similar expression to set the symbol to a TRIANGLE when the value is 999.

In this case, some of the symbols display VERY SMALL on the map - UNTIL you zoom in, then the features show at the correct size. (see attached for screen shot). Some triangles show where they should but features from both pass/fail display very small.

Expression Example:

case when "projected_school_id" = '999' then 'triangle' end

case_2.JPG (32.2 KB) Matthew Baker, 2018-11-20 06:14 PM

History

#1 Updated by Matthew Baker over 1 year ago

Also affects version 2.18

#2 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Feedback

id the column is integer (and you want to evaluate the content as integer) then is not '999' but just 999.

#3 Updated by Matthew Baker over 1 year ago

Ah that seems to be the issue - also having an 'else' clause seems to fix this as well... strange, but simple fix - sorry to report this as a bug, so feel free to close/delete as you see fit.

Giovanni Manghi wrote:

id the column is integer (and you want to evaluate the content as integer) then is not '999' but just 999.

#4 Updated by Giovanni Manghi over 1 year ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF