boostorg/geometry — pull request #160 by awulkiew (2014-10-13 23:52:45+00:00)
Title: Fix/read wkt

This PR changes the behavior of `read_wkt()` for open Rings to be consistent with `wkt()` output and in the same time backward compatible. `wkt()` always outputs the closing Point, even for open Rings to be WKT-standard-conformant. Without this fix `read_wkt()` naiively appends all Points passed in the input. This means that if a WKT generated with `wkt()` is loaded with `read_wkt()` into an open Polygon the last, duplicated Point is appended. This PR changes the `read_wkt()` in a way that it doesn't append the last Point of the input if it equals the first one.

The interesting edge case is when there is not enough Points in the input (i.e. less than 3 for open Ring) Points are always appended. Though I'm not sure if this is needed. It of course may be changed to always ommit the last, duplicated Point.