3

I have a map with many layers, each one of them showing multiple points for different cities. For some locations, having the same lat and long data, these points are overlapping, being on top of each other, so I'm able to see only the one from the top.

Is there any way QGIS warn / signalize / indicate this issue so that I can manually move the one from the top?

1
  • 5
    Just display the pointlayer at the bottom of your layer list the largest, and make the points smaller, the "higher" you get. No additional work required.
    – Erik
    Commented Apr 28, 2023 at 7:37

3 Answers 3

3

You can create a Virtual Layer with the query:

select row_number() over() as id, geometry, count(*) as pointcount
from
(select geometry from layera
union all
select geometry from layerb
union all
select geometry from layerc) sub
group by geometry
having count(*)>1

Adjust layer names and add more rows for your layers

It will count duplicates by geometries and create a point layer showing them:

enter image description here

3
  • Thanks! This seams to be the solution, but I get an error when I try to create the virtual layer. I've change only the layer names in your code. Should I change or add something else? I'm totally new to this. Commented Apr 29, 2023 at 5:41
  • What is the error message? Can you add the code you are using to you question?
    – Bera
    Commented Apr 29, 2023 at 8:43
  • This is the CODE: select row_number() over() as id, geometry, count() as pointcount from (select geometry from 1-1 union all select geometry from 1-2 union all select geometry from 1-3) sub group by geometry having count()>1 And this is the ERROR: Query execution error on CREATE TEMP VIEW _tview AS select row_number() over() as id, geometry, count() as pointcount from (select geometry from 1-1 union all select geometry from 1-2 union all select geometry from 1-3) sub group by geometry having count()>1: 1 - near "1": syntax error Commented Apr 29, 2023 at 9:55
2

If you want to manually move the point. Use Select Within Distance from the Processing Toolbox.

Select Within Distance

Then the Move Feature tool from the Advanced Digitizing Toolbar.

Move Feature

0

The easiest way to show overlapping points is to set layer rendering style to Point Cluster. You will automatically see how many points are clustered in one location.

This works for points on the same layer. So first create a new layer, combining all point layers, using Menu Processing > Toolbox > Merge Vector layers with all point layers as input. Then apply Point cluster style to this layer to see where points are overlapping.

Instead of this, you could also create a virtual layer to create a layer containing all points - similar to the solution by @Bera, but with an easier query, without counting the points. This part is done by the point cluster renderer:

select points1.geometry as geom from points1
union all
select points2.geometry as geom from points2
union all
select points3.geometry as geom from points3

Blue dots: single points; red dots: showing number of points from all three initial point layers, clustered in this place: enter image description here

Your Answer

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

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