3

I have a .csv file pointing at coordinates. It is a large file that is edited often.

In it, I have three groups of data (say A, B, and C).

Within each group there are a number of Names, and each name has ten sets of coordinates. I would like to keep all of this data in one spreadsheet.

How can I set the categorization in QGIS to show each Name with it's own colour from only Group A?

I hope to create three layers, one for each group, all pointing to the same .csv file.

I think I need to do this in the Expression dialog box but can't seem to work it out.

For example:

NAME,GROUP,Easting,Northing Orange,A,, Orange,A,, Orange,A,, Orange,A,, Orange,A,, Orange,A,, Red,B,, Red,B,, Red,B,, Red,B,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Green,B,, Green,B,, Green,B,, Green,B,, Green,B,, Green,B,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,,

2

I think Joseph's answer is very helpful but that it does not meet all of your hopes.

You wrote in your question:

I hope to create three layers, one for each group, all pointing to the same .csv file.

So this is the way you can do that:

Add your csv data to QGIS 3 times - Rename each layer according to GROUP

Set appropriate filter to your layers - iterate steps 1 and 2 for all layers with different GROUP argument.

  1. Right click on layer name choose Filter

    enter image description here

  2. Filter your layer to a subset by GROUP

    enter image description here

  3. Create rule based style for first layer, for each NAME (detailed steps in Joseph's answer)

    enter image description here

  4. Copy - paste style over the rest of layers

    enter image description here

Save your work as QGIS project file so as you'll save the reference to .csv and layers subsets and styling. So there will be no problem after updates in csv file.

2

Assuming I understood your question, you can do the following:

Layer Properties > Style

Select Rule-based, double-click on a rule to bring up more options. Taking orange as an example, use this command:

"Name" = 'Orange'

Rule Properties

Click 'OK' and add more rules and repeat the same steps as above. You would only need to change

'Orange'

Once you've done this, you should get something similar to this:

Style Properties

Then you should have multicoloured results:

Layer results

And if you wanted, you can add annotations to it. I added labels in to differentiate which groups the points belong to. You can do this via Layer Properties > Labels:

Label options

Layer results with labels

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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