-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refine rules (add ranges/categories): expressions not applied/written correctly #19191
Comments
Author Name: Nathan Woodrow (@NathanW2) That isn't doing what you expected it to. What you are doing there is making a range based on the results from the expression "pntcnt" > 4802 which is from 0 -> 1. What you are looking for isn't implemented yet. |
Author Name: baditaflorin - (baditaflorin -) Yes it is implemented, i discovered it now CASE WHEN "pntcnt" <50 THEN "pntcnt" END Thanks for the quick reply |
Author Name: baditaflorin - (baditaflorin -) This is strange, doing a query like this works CASE WHEN ( "pntcnt" <100.1 ) THEN "pntcnt" END But searching for bigger numbers not working CASE WHEN ( "pntcnt" >100.1 ) THEN "pntcnt" END Or if i search only for 200, i get all the values until 200, as seen in the photo In this sense you say that is not implemented, that it works only with < ?
|
Author Name: baditaflorin - (baditaflorin -) If i choose refine by category, then the CASE ELSE is working, even with CASE WHEN "pntcnt" >= 50.1000 AND "pntcnt" <= 100.1 THEN "pntcnt" END As can be seen in the photo
|
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Giovanni Manghi (@gioman) This is what I see (please correct me if I'm wrong): categorized renderer
@case WHEN "NUMPOINTS" >= 50.0000 AND "NUMPOINTS" <= 100.0 THEN "NUMPOINTS" END@ this will effectively create a subset of values and for each of them it will create a separate symbology class
@"CASE WHEN ""NUMPOINTS"" >= 50.0000 AND ""NUMPOINTS"" <= 100.0 THEN ""NUMPOINTS"" END" = 68.0000@ and this is wrong, in fact if I remove the not necessary '"' the expression works @case WHEN "NUMPOINTS" >= 50.0000 AND "NUMPOINTS" <= 100.0 THEN "NUMPOINTS" END = 68.0000@ (and otherwise testing the filter/expression fails with "Column 'CASE WHEN "NUMPOINTS" >= 50.0000 AND "NUMPOINTS" <= 100.0 THEN "NUMPOINTS" END' not found")
@ "NUMPOINTS" > 100@ will return 1 or 0 (depending if is true or not that the feature has more than 100 "NUMPOINTS"). This will work ok in the standard categorized renderer but in the rule based one, when refining by category it will result in rules with too many '"', example @"CASE WHEN ""NUMPOINTS"" >= 50.0000 AND ""NUMPOINTS"" <= 100.0 THEN ""NUMPOINTS"" END" = 59.0000@ Similar observations can be done for graduated renderer:
@case WHEN "NUMPOINTS" >= 50.0000 AND "NUMPOINTS" <= 100.0 THEN "NUMPOINTS" END@ can be used to effectively render (by ranges) only the features with "NUMPOINTS" between 50 and 100
"CASE WHEN ""NUMPOINTS"" >= 50.0000 AND ""NUMPOINTS"" <= 100.0 THEN ""NUMPOINTS"" END" >= 84.0000 AND "CASE WHEN ""NUMPOINTS"" >= 50.0000 AND ""NUMPOINTS"" <= 100.0 THEN ""NUMPOINTS"" END" <= 97.0000
@ "NUMPOINTS" > 100@ This does not seems to work on 2.2 either, where the expressions were introduced to allow more advanced categorized/graduated symbology, then it should be tagged as blocker, because is a new feature that does not work as expected (at least inside the rule based symbology).
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Vladimir Udilov (Vladimir Udilov) I can reproduce this bug in 2.10.1.
|
Author Name: Nyall Dawson (@nyalldawson) Some more detail in #21603 |
Author Name: Nyall Dawson (@nyalldawson)
|
Author Name: Nyall Dawson (@nyalldawson) Fixed in changeset "ae85376614f27da2d3f4b389e26539709a1be5e0".
|
Author Name: Jürgen Fischer (@jef-n)
https://issues.qgis.org/issues/10815#note-7 old description: Expected result . To filter only the numbers on the pntcnt that are higher then 4802 "pntcnt" > 4802 Instead i get only 5 values, from 0-0.2 old description: Expected result . To filter only the numbers on the pntcnt that are higher then 4802 "pntcnt" > 4802 Instead i get only 5 values, from 0-0.2 |
Author Name: baditaflorin - (baditaflorin -)
Original Redmine Issue: 10815
Affected QGIS version: master
Redmine category:symbology
Assignee: Nyall Dawson
new description:
#10815-7
old description:
Expected result . To filter only the numbers on the pntcnt that are higher then 4802
"pntcnt" > 4802
Instead i get only 5 values, from
0-0.2
0.2-0.4
0.4-0.6
0.6-0.8
0.8-1
Related issue(s): #18891 (duplicates)
Redmine related issue(s): 10479
The text was updated successfully, but these errors were encountered: