0

I took a very good course on QGIS from Udemy (GIS in QGIS 3 for beginners) and made a pretty complex map with it. A month or so afterwards, I made a pretty simple map without any problems using a rule-based style. Five months or so have passed so I'm a bit rusty, but I'm trying to make a map with a rule-based style and for no reason I can understand, the points won't show up. I'm able to make a graduated size based style with the size based on an attribute (numbers) in my .csv file that I used to make a delimited text layer: enter image description here

But then when I try to create a rule-based style based on another attribute (there are five different words in one column of the .csv that describe categories and I want each category to have a different color, and I want the size to be graduated just like in the screenshot above), no points at all appear. This is from the same .csv file so I have no idea what is going wrong. First, what I found strange was that the 'Count' and 'Duplicate count' show up as zero, even though the filters appear to work.

enter image description here

Now you can see (I've hid the countries map layer) that none of the points appear at all.

enter image description here

I created the same exact type of rule-based style (different colors for different rules) in my previous map without any problems, and I opened it up and compared it and couldn't find any differences. Please help, it's an important assignment for work and I don't know anyone that can help me.

At request of commenters, here is the attribute table. Based off of what another poster said, I also created another .csv with only the necessary columns (fishery name, certification status, total volume, latitude, and longitude), but still ran into the same problem, so it's not that there are too many columns or blanks or anything like that.

enter image description here enter image description here

Edit: OK NOW I solved the problem by just using the gradient style (based on size) and then converting that into a rule-based style (when I tried the same for categorization style, it didn't work). From that rule-based style, I clicked 'Refine selected rules' and then clicked on 'Add categories to rule' and manually created the color scheme for each size-based rule. Unfortunately, in a few places, two points were created in the same place, one of which is the default blue color and the largest possible size, the other of which is the custom color, and always the same size (2.0, as it says when I edit that color categorization underneath the rule). In many places though, the blue big-sized dot does not appear, because it is smaller than 2.0. How can I fix this?? I can't turn it in until it's perfect.

Edit again: duh, I needed to go in and change the size of each one of the markers nested within the size rule so that it is the same size as the size-based rule's marker. But then they just all show up as that same dark blue. How do I make the color-based rule be processed first even though it is nested within the size-based rule? Starting from categorization rather than gradient would have been much easier, too bad that didn't work!

Edit again: FINISHED. Fixed that last issue by clicking on 'Symbol levels' and assigning the top size-based rule to 0 and the color-based rules to 1.

enter image description here enter image description here

7
  • Please add a screenshot of your attribute table.
    – Erik
    Jul 21, 2021 at 19:49
  • for the count/duplicate counts, you would have to click the sum button to update these values (they are purposely left at 0 by default). We can see in the legend though that each rule has a >0 count, so the filter seems fine. Is there any data-override in the style? (which could toggle the visibility, set a size of 0, opacity of 0 etc based on some conditions).
    – JGH
    Jul 21, 2021 at 20:12
  • Also check the layer rendering settings, such as the opacity
    – JGH
    Jul 21, 2021 at 20:15
  • Hi @Erik, screenshots were added to the end of the individaul post.
    – nax2021
    Jul 22, 2021 at 0:01
  • @JGH, I checked the layer rendering, and the opacity is at 100% (didn't post screenshot to keep the OP from getting too long). I have to admit that I don't really understand the 'Count' field, and I don't know where the 'sum' button is, but it doesn't seem that there is a lack of updating of the values. I don't think there is any data-override. The size is on 2 and the opacity is on 100% for all of the markers.
    – nax2021
    Jul 22, 2021 at 0:11

3 Answers 3

2

I know you already solved the problem but for anyone out there with a similar issue...

The reason your points were not showing up might be due to the space in your column title 'Certification Status'. I had a similar problem and removing the space in the column title (in the csv file and the filter) solved it!

1
  • This seems to be it. I had the same problem and fixed it by duplicating the column into a new one with underscores instead of spaces.
    – Hjall
    Dec 15, 2022 at 14:27
0

Perhaps create a categorized style on the field you want and then change the style to rule based. Then the concrete rules will appear in the settings formular. What i further came across is that there should not be an empty column in csv, somehow i had cases where the colums not matched the entries below.

2
  • I followed your advice: I created it as a categorized style, which works (color based on status), but then as soon as I changed it to rule-based, without making any other changes (in other words, the rules showed up automatically, having been generated from the categorized style), the points all disappeared on the map. So the issue seems to be with any sort of rule-based style. I hit the 'count features' button and it still shows as all 0's, even though the filter says that it's returning x amount of features. So I'm stumped.
    – nax2021
    Jul 22, 2021 at 0:20
  • OK, it ended up working the other way around: by creating a gradient style (based on size) and then changing it to rule-based. When I did that, the points didn't disappear. But now there is a new problem (see OP above). Thank you for your help thus far!!
    – nax2021
    Jul 22, 2021 at 1:08
0

I had the same issue of disappearing points, but I fixed it by creating a new column in the attribute table. I think this worked because my column title was too long or because it had characters /1, so the rule based categorizing tool could not find the information (and everything got the value "else").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.