Skip to main content
added 62 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

The specification of any polyline is a little optimistic (given the possibility of duplicate geometries), but for a topologically correct network it can be done using a virtual layer"Virtual Layer" through Layer > Add Layer > Add/Edit 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'edges' and its geometry field is called geometry:

SELECT * from
FROM (
    (SELECT ST_StartPoint(geometry) AS geom
    FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom
    FROM edges
    ) AS startend
 
JOIN edges 
    ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

The specification of any polyline is a little optimistic (given the possibility of duplicate geometries), but for a topologically correct network 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 geometry:

SELECT * from 
    (SELECT ST_StartPoint(geometry) AS geom FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom FROM edges) AS startend
 
JOIN edges 
ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

The specification of any polyline is a little optimistic (given the possibility of duplicate geometries), but for a topologically correct network it can be done using a "Virtual Layer" through Layer > Add Layer > Add/Edit 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 geometry:

SELECT *
FROM (
    SELECT ST_StartPoint(geometry) AS geom
    FROM edges
    UNION 
    SELECT ST_EndPoint(geometry) AS geom
    FROM edges
    ) AS startend
JOIN edges
    ON ST_Intersects(startend.geom, edges.geometry)
GROUP BY startend.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

added link to docs
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59

ItThe specification of any polyline is a little optimistic (given the possibility of duplicate geometries), but for a topologically correct network it can be done using a virtual layervirtual 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 geometry:

SELECT * from 
    (SELECT ST_StartPoint(geometry) AS geom FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom FROM edges) AS startend

JOIN edges 
ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

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 geometry:

SELECT * from 
    (SELECT ST_StartPoint(geometry) AS geom FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom FROM edges) AS startend

JOIN edges 
ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

The specification of any polyline is a little optimistic (given the possibility of duplicate geometries), but for a topologically correct network 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 geometry:

SELECT * from 
    (SELECT ST_StartPoint(geometry) AS geom FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom FROM edges) AS startend

JOIN edges 
ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

capitalised funtion names
Source Link
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 geometry:

SELECT * from 
    (SELECT st_startpointST_StartPoint(geometry) asAS geom fromFROM edges
     UNION 
     SELECT st_endpointST_EndPoint(geometry) AS geom FROM edges) AS startend

JOIN edges 
ON st_intersectsST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.geom
HAVING countCOUNT(*) = 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

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 geometry:

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

JOIN edges 
ON st_intersects(startend.geom, edges.geometry)
     
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

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 geometry:

SELECT * from 
    (SELECT ST_StartPoint(geometry) AS geom FROM edges
     UNION 
     SELECT ST_EndPoint(geometry) AS geom FROM edges) AS startend

JOIN edges 
ON ST_Intersects(startend.geom, edges.geometry)
     
GROUP BY startend.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

simplified expression
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59
Loading
simplified expression
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59
Loading
edited body
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59
Loading
added 116 characters in body
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59
Loading
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59
Loading