Skip to content
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

EXP DIALOG AND (RANDOM) COLOUR_RGB #24703

Closed
qgib opened this issue Jul 6, 2017 · 5 comments
Closed

EXP DIALOG AND (RANDOM) COLOUR_RGB #24703

qgib opened this issue Jul 6, 2017 · 5 comments
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feature Request

Comments

@qgib
Copy link
Contributor

qgib commented Jul 6, 2017

Author Name: f ffierm (f ffierm)
Original Redmine Issue: 16804

Redmine category:expressions


Hi,

after loading a vector data, polygon, I would to display a thematic map using: VECTOR LAYER - PROPERTIES - STYLE - CATEGORIZED - EXPRESSION DIALOG with this code:
CASE
WHEN "layer" ='value_1' THEN color_rgb( 0,0,0)
WHEN "layer" ='value_2' THEN color_rgb( 110,110,110)
WHEN "layer" ='value_3' THEN color_rgb( 255,255,255)
END

When I apply the request, QGIs show "wrong" RGB code (the same happens using color_cmyk).
What goes wrong? May you help, please?

Thanks

Ciao,
f.fiermonte

@qgib
Copy link
Contributor Author

qgib commented Jul 6, 2017

Author Name: Nyall Dawson (@nyalldawson)


That's not correct use of categorised renderer.

Categorize on the attribute "layer" and then set the color manually for each generated symbol.

Or alternatively (more complex way) use the single symbol renderer and then use your expression as a data defined fill color override.

Please open a question on http://gis.stackexchange.com/ if you need further assistance of this nature (it's not a bug or feature report, so doesn't belong here).


  • resolution was changed from to invalid
  • status_id was changed from Open to Rejected

@qgib qgib closed this as completed Jul 6, 2017
@qgib
Copy link
Contributor Author

qgib commented Jul 7, 2017

Author Name: f ffierm (f ffierm)


First of all, thank You for the answer. If I follow your tips and I use the "single simbol" option the code I wrote works fine.

But, this is the problem, your "workaround" leave me surprised. My goal is to make a "categorized map" (and not a "single symbol" rendering). The "correct place" in which to put this function, maybe, is under "categorized" option (in my opinionit is a "logical problem").
Thanks.
Ciao,
francesco fiermonte

@qgib
Copy link
Contributor Author

qgib commented Jul 7, 2017

Author Name: Giovanni Manghi (@gioman)


f ffierm wrote:

First of all, thank You for the answer. If I follow your tips and I use the "single simbol" option the code I wrote works fine.

But, this is the problem, your "workaround" leave me surprised. My goal is to make a "categorized map" (and not a "single symbol" rendering). The "correct place" in which to put this function, maybe, is under "categorized" option (in my opinionit is a "logical problem").
Thanks.

it is not a workaround, it is how it supposed to work in qgis.

@qgib
Copy link
Contributor Author

qgib commented Jul 7, 2017

Author Name: Regis Haubourg (@haubourg)


f ffierm wrote:

First of all, thank You for the answer. If I follow your tips and I use the "single simbol" option the code I wrote works fine.

But, this is the problem, your "workaround" leave me surprised. My goal is to make a "categorized map" (and not a "single symbol" rendering). The "correct place" in which to put this function, maybe, is under "categorized" option (in my opinionit is a "logical problem").
Thanks.
Ciao,
francesco fiermonte

Just to clarify things. Doing a category analysis must be simple for user. Using the category renderer and pointing the field to use is straightforward. It initiaze classes with pseudo random colors, and the a user can change it by hand.
Using CASE WHEN syntax is pretty advanced already, but you can do it if you want using data defined widgets available everywhere. I know no GIS tool asking you to type a CASE WHEN expression for a simple categorized map in first intention, but I know no other GIS tool than QGIS that allows you to do it if you really want to.

@qgib
Copy link
Contributor Author

qgib commented Jul 10, 2017

Author Name: f ffierm (f ffierm)


Dear Giovanni and Dear Regis,

first of all, excuse me for my trembling english and thank you for the answer.

@giovanni: Maybe, in this case, QGIS seems to be "too much" free: in my opinion, a function that performs a "categorized output" shoud not be found onto a "single symbol" menu. It is a simple logical issue. If I'm wrong, can you help me describe it better in order to share your knowledge with our students? Thank you.

@regis: I agree with you: a category analysis must be simple for the user. But, if a function exists, this tool must be properluy placed and never cannot give wrong results... If this is not a good way to go, the function should be "removed". If a student ask me: "what is the meaning of the function...?" I should search the correct way to answer and not speech about philosophy...

Thank to all for the cooperation.
Francesco.

@qgib qgib added Feature Request Expressions Related to the QGIS expression engine or specific expression functions labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant