Repository navigation
r.shade: Prevent GUI console to overwrite color table of output - #6903
Conversation
Added exception handling for specific modules in gconsole.py to avoid that the GUI console automatically applies a color table to the output, thereby overwriting the intended RGB colors. See OSGeo#6826
Co-authored-by: Nicklas Larsson <n_larsson@yahoo.com>
petrasovaa
left a comment
There was a problem hiding this comment.
This is misunderstood. r.mapcalc is not exempt, it just required different parsing than all other tools. The only change here that makes sense is fixing the errors, indeed, KeyError seems wrong.
|
@ecodiv the changing of the color table should happen only if you have it in the settings (Layers - Default raster settings), please make sure it's not checked. If the problem persists, I would need to look into it more. |
|
Thanks for the feedback. I'll have a look at my settings. But I think irrespective of the setting, this module should be exempted because it never makes sense, the whole purpose of that module is to define a very specific color table. |
@petrasovaa The default color table is unchecked. But I just ran mapcalc, and the outcome got automatically assigned the viridis color table. (grass 8.6dev on Linux) |
Viridis is the default, so I guess I don't understand what is the problem? |
You're right, sorry for the noise. |
Do you have any ideas how to deal with modules that create output rasters that should not get assigned a color table? In the current situation, r.shade isn't useful. |
petrasovaa
left a comment
There was a problem hiding this comment.
From this PR I isolated the error fix unrelated to the issue.
|
I suggest to further discuss the topic in the issue, this PR with the little exception fix will get merged. |
Added exception handling for specific modules in gconsole.py to avoid that the GUI console automatically applies a color table to the output, thereby overwriting the intended RGB colors.
An attempt to solve the issue reported in #6826. I applied the patch, and for me, it seems to work.