Bug report #20567
Overriding symbols with expressions produces strange scale-related issues
|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|
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.
- 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
- 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.
case when "projected_school_id" = '999' then 'triangle' end
#3 Updated by Matthew Baker almost 3 years 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.