3

In QGIS I have two layers of points. In these two layers, my points have different degrees or size :

  • Layer 1 : the point "a" has a size of 3, and the point "b" has a size of 8. The color of these two points is red.

  • Layer 2 : the point "a" has a size of 5, and the point "b" has a size of 2. The color of these two points is green.

When I overlap these two layers, then if I place the layer 1 first, we won't be able to the see point "b" of the layer 2. Conversely, if I place the layer 2 first, we won't be able to the see point "a" of the layer 1.

To fix the problem, I tried to go on: Propriété de la couche -> Symbologie -> Rendu de couche -> Entité and I choose Multiplier, to make points translucent, but the results are not satisfying me.

Is there a way to overlap these layers so that we place the points whose size is the smallest, above the points of larger size, despite their belonging to two different layers?

5
  • what do u call "size" ? is it "real" size (like in meters ...) or is it the "symbol size" parameter u use in your symbology ? is this information somewhere in your attribute table ?
    – Snaileater
    Apr 8, 2020 at 8:58
  • Yes @snaileater I use some infos on my attributes to establish a scale of representation, thanks to the symbology parameters Apr 8, 2020 at 9:26
  • 1
    You may consider splitting the points in multiple layers (by size) or on the contrary to merge them all into a single layer. In both case the data remains in the original layers, you would only load it twice + filter, or merge them using a virtual layer
    – JGH
    Apr 13, 2020 at 10:14
  • @JGH yes thanks I understood ! Apr 13, 2020 at 11:11
  • another possibility is to symbolise with an empty circle (colored outline, transparent fill) depending on your data and base map it could look nice or be illegible just try....
    – J.R
    May 18, 2021 at 13:16

3 Answers 3

2

On the layer that is on top, add a new symbol layer of type Geometry generator (see documentation) / Point. Use this expression to generate the point from the other layer that is closest to the current feature:

overlay_nearest('other_layer', $geometry)[0]

Set the same settings for size. To avoid the larger points from this symbol layer to cover your initial points, add an if-condition to the above expression, so that only the small (covered) points are rendered.

You do not mention based on what condition points on layer2 are rendered with size 2 or 5. In my case, the size of the (partially covered) layer2 is based on $id: if it is an even number - size 5, otherwise 2. Use your condition in the same way.

By the way: red/green is considered bad practice in cartography due to color blindness issues. That's why I changed to red/blue:

enter image description here

0

There's a tiny option button next to the size parameter in the symbology tab. You can choose "Edit..." and pick the attribute which will give the point the size you want.

In french it's called 'Definition de donnée imposée', click 'Editer...' and choose your "size" attribute in the 'Constructeur de chaine d'expression'.

4
  • I already did that but my point is to overlap my two layers so that smaller ones can be in front of the bigger ones, despite the layers Apr 10, 2020 at 8:16
  • If your symbology is a simple point, you can make it transparent and the small ones will be seen through the big ones.
    – LeoC
    Apr 10, 2020 at 8:28
  • That's exactly what I have already done, and trying to do it another way, because if I do it for 4 layers then we are not able to distinguish colors anymore... :( Apr 13, 2020 at 11:09
  • Have your tried "déplacement de point" or "groupe de point" option when generating geometry? it's not exactly what you want but it can help seeing overlapping points. An other trick could be to use Labels as points and give each label a rule based priority.
    – LeoC
    Apr 13, 2020 at 12:22
0

This is a hack, but instead of symbolizing them you could label them with symbology. I believe, labels give you the option of draw order across layers.

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.