|
I added the condition that the dangle should have another line within 2m from it to be considered a node. If it is more than 2m, then we assume that it must be a terminating node, and not a dangle. Unfortunately, to do it, I had to institute the FIRST clause again for the ID. It is a bit slower, but we've just added some nice flexibility: SELECT g INTO dangles FROM [PRIMARY_LINES], ( SELECT FID, g FROM (SELECT first(ID) AS FID, g, count(*) AS cnt FROM (SELECT ID, GeomMakePoint(GeomCoordXY([Geom (I)], 0)) AS g FROM [PRIMARY_LINES] UNION ALL SELECT ID, GeomMakePoint(GeomCoordXY([Geom (I)], GeomCoordCount([Geom (I)])-1)) AS g FROM [PRIMARY_LINES]) AS T GROUP BY g) AS T2 WHERE cnt = 1) AS T3 WHERE GeomDistance(g, [Geom (I)], 0) < 2 AND FID <> ID
|