I have a PostGIS table of linestrings representing a road network. I want to simplify the geometries such that only lines that connect road junctions are stored.
At the moment the table has a large number of road segments that make up a single road. I want to join as many of these as possible into a single linestring. Such that:-
x----x----x----x becomes x------------x
x x | | x----x----x----x becomes x----x--------x
It is important that I retain the points in each linestring so I am not looking to simplify to a topology.