Skip to main content
4 of 8
simplified expression
Matt
  • 17.9k
  • 4
  • 23
  • 59

It can be done using a virtual layer. This query first collects all start and end points into one table, then selects those points which intersect only once with the lines layer.

Assuming the line layer is called edges and its geometry field is called geom:

SELECT * from 
    (SELECT st_startpoint(geom) AS geom FROM edges
     UNION 
     SELECT st_endpoint(geom) AS geom FROM edges) AS startend

JOIN edges 
ON st_intersects(startend.geom, edges.geom)
     
GROUP BY geom
HAVING count(*) = 1

enter image description here

Note: The seemingly missing point towards the lower left of the image is actually a cul-de-sac and not a dangle! enter image description here

Matt
  • 17.9k
  • 4
  • 23
  • 59