-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
d.vect: Apply variable color only to area fill #1146
base: main
Are you sure you want to change the base?
d.vect: Apply variable color only to area fill #1146
Conversation
Always use (respect) the color option for the area boundary and apply color table and other variable color options only to the area fill (as fill_color).
@landam Can you please comment both on the whether you agree with the change of behavior and on the correctness of the implementation? And/or suggest another reviewer. Works for me as expected with the vector color table, RGB column, cat-based random colors, and without any of those but color and fill color specified. |
Added images to the description and highlighted the controversy. |
Hi @wenzeslaus. I'm against this PR. I think, with only one option for an RGB column, the current behavior (same color for both area and boundary) is more expected. Also, leaving thin gaps would not be acceptable in some case. Why don't we split
Last, with this PR, |
I did a little test. By default, the current d.vect only draws points, lines, areas, and faces from the command line. From the GUI, it draws boundaries as well. I created a red-only RGB column
To mimic your problem (no separate single boundary color),
To overlay boundaries (what you want?),
In d.vect, area borders are drawn by From the GUI, it just works because boundary is drawn by default using the Now, do we need variable colors for area borders (separate from fill colors) or boundaries (new)? That's a different story. |
@wenzeslaus Is this PR still relevant? I cannot reproduce this issue. From the NC sample mapset, g.copy vect=boundary_county,tmp --o
v.db.addcolumn map=tmp col="rgb_color varchar(50)"
v.db.update tmp col=rgb_color querycol="abs(random()%255) || ':' || abs(random()%255) || ':' || abs(random()%255)"
d.mon start=wx0
g.region vect=tmp
d.vect map=tmp rgb_column=rgb_color color=black type=area,boundary |
I was concerned with color table meaning the color rules saved with the map (
It still seems to behave the same when I use simple d.vect without checking the The behavior seems strange since the boundaries are part of areas in GRASS and they are rendered with |
@HuidaeCho Looking at comments here again, it seems your first and second test is the same, in both cases you ended up adding One use case for this would be the world map we show when GRASS GIS starts the first time. Using a workaround there would be okay-ish temporarily, but we don't want to keep using a workaround there. (Using RGB column there would be fine too in this case possibly lowering priority of this PR/problem.) So, I think this PR (or another fix) is still relevant. |
I see. You were not talking about the
doesn't draw the area-color boundaries anymore. It uses the default solid color now and we lose the area-color boundary feature, which I believe we have to keep supporting.
behaves consistently with your Let me summarize the current behavior without this PR.
So the only time boundaries are drawn in their own single color is when areas are not assigned any colors either though What you need is again
This is not a temporary workaround. It uses a feature of In the end, what would be the point of |
I would say that is a bug.
Lines 441-442 in |
First of all, I'm all for replacing this PR with something better. However, I have some concerns with what you are suggesting which will explain why I though it is only a workaround. The last two commands in your bigger example miss Your In this perspective, the width behavior makes perfect sense. This PR works with this understanding too. It changes the d.vect behavior so that it assumes not only you don't want centroid to be rendered by default, but newly also assumes that you want boundaries rendered in a constant color. Your approach seems to say that area for d.vect means skip not only centroids but also boundaries and render only what d.vect calls fill. In that case, I would say, boundary needs to be added to the defaults for type to achieve the expected behavior (and the boundaries with Both figures: Same world map with color table as above, but with # bottom
d.vect map=country_boundaries@with_color_table type=point,line,boundary,area,face color=0:29:57:255 width=11
# top
d.vect map=country_boundaries@no_color_table color=255:255:255:255 fill_color=none width=1 |
I found this sentence from the d.vect manual:
I think you're right that the original intention was to draw boundaries with areas by default. That's interesting. I always assumed based on the behavior of |
Just curious.. Is it intended? |
Bumping up milestone as 8.0.1 is due in two days, while this has not been part of RC1 and there has not been activity for some time. |
Solved conflicts |
Always use (respect) the color option for the area boundary and apply color table
and other variable color options only to the area fill (as fill_color).
Before
After
Previously, this was only possible by drawing the vector again using another layer (or vector map copy in case color table was used).
Trying to get old behavior with the new code
Unfortunately,
color=none
which disables drawing boundaries leaves thin white (bg color) lines in between the areas, so the old behavior cannot be exactly reproduced like that.