• andyscott (9/16/2014)


    A breakthrough! I've managed to find a way to sort the individual line segments into order, reversing those that were "backward" with respect to the others. In the process I found a "rogue" line which, once removed, allowed the shape to close. Thereafter, the UnionAggregate function returns a LINESTRING (instead of a MULTILINESTRING) and the original suggestion for using REPLACE to change the format from LINESTRING (..... to POLYGON ((... works a treat.

    Thanks guys - I now have the polygon that I needed. :-):-)

    Good stuff and good job,

    and an ample reminder that it is as important to assert the data as the code;-)

    😎