I have groups of individual linestrings segments with spatially coincident start & end points. I want to convert them into individual linestrings as seen in the picture:
This seems like it should be very easy but I cannot figure out how to do it. ST_Union
is just returning all features in the entire set, i.e. every single feature from both groups in the picture becoming a single multilinestring.
I don't have a common identifier field for the groups of linestrings, the only thing that indicates that they belong together is the fact that they touch each other at their endpoints.
Am I missing something obvious here?