In PostGIS, what if anything controls the direction that
LINESTRINGs will have when converted to
It doesn't appear to be the order in which the edges are listed in the call to
CreateTopoGeom. Which makes sense in the presence of loop edges, I guess, although presumably you could define the direction of a linestring that starts with a loop edge to be in the direction of that edge.
Is it even stable? If I do a bunch of edge splitting/healing, is it possible that the system will flip my linestrings that include those edges? If it's at least guaranteed to be stable I could include a
should_be_reversed boolean column in the table that includes the linestring topogeometry column, and call
ST_Reverse on the resulting
geometry in a view?