Open DelazJ opened 4 years ago
if you use "gid"=12, does that work? Wait ther are no 12 in your data...
The classify will only return observed values, not possible values. If the tool would return all possible values you would have millions of values all the time, this doesn't make sense.
I'm pretty sure this one isn't a bug, if you want to represent a value that isn't present just add it manually. The tool doesn't see it as boolean but as integer.
The classify will only return observed values, not possible values. If the tool would return all possible values you would have millions of values all the time, this doesn't make sense.
gid = 12
as an expression is a boolean check, not an integer. It checks whether the field has value 12 or not. not checking what possible values the field should have. And for a boolean, possible values are true
or false
nothing more. Now if you say; it returns observed values, it explains the gid=12
outputs (0
) but not the empty output for toto (should be 0
) or atlas_feature ones (should be 0
and 1
).
As for toto the only value observed is false because gid is never = toto. the atlas feature one is a toss up depending if th atlas is active, not sure about the preview.
As for toto the only value observed is false because gid is never = toto.
Yes, the 'toto' case would also be OK, for observed values. I doesn't output an empty value as I said just above.
the atlas feature one is a toss up depending if th atlas is active, not sure about the preview.
Of course the atlas is active, otherwise the preview wouldn't evaluate to 0 or 1 and these results are correct. If inactive, I guess you'd get either 0 or Null (didn't check and this is not the point here). If "Classify" returns the observed values, it should return what the preview shows. If not, then one of them is buggy.
Only the cas of the atlas feature is a valid bug to me. Evaluating an '=' can never be null, only 0 or 1.
Still valid on QGIS 3.22.4. and 3.24.0.
In Layer Properties, Symbology, Categorized, using an expression returning a boolean does not seem to always return all possible values, ie
0
,1
(andall other values
) See classes ofgid=attribute(@atlas_feature, 'gid')
,gid=12
andgid='toto'
belownote:: While the expression preview shows 0 or 1 in the screencast, I get the same "bug" for expressions that previews as true/false (eg,
is_selected( @atlas_feature)
)