I am using bellow query to get all the intersecting points from my line_string table.
select a.line_id,(st_dump(st_intersection(a.geom, b.geom))).geom from roads a, roads b where st_touches(a.geom, b.geom);
In the above image blue dots are all detected points, where as red boxes are missed in detection.
There will be 2 possibilities.
One is marked in green, where roads are not intersecting (fly-over/under pass roads). Where geometry is not touching. OR two lines are not snapped/connected correctly.
But in the above image I cross checked many non detected lines, but they are perfectly snapped/connected.
I can use
ST_Intersects in place of
ST_Touches But the problem is,(If i am not wrong) it matches geometry spatially which leads to detecting intersecting points in flyover / underpass roads also.
Can anyone help me in understanding why its not detecting all intersecting points and how to correct it?
I also need to detect start or end point which is not intersected with other lines as intersecting point.