[GGL] Is this a bug, or undocumented behavior?

I have been running some of my own polygon union test cases on the union_inserter. The union_inserter doesn't appear to return a minimal set. E.g. if the start point of a polygon appears in the union, it will appear twice (consecutively). Is this expected behavior? If so, it should probably be documented. I have some other algorithms which expect a sequence of unique points, so I would need to pre-process the result of this function call. Thanks, Jon

Hi Jonathan, Jonathan Franklin wrote:
I have been running some of my own polygon union test cases on the union_inserter. The union_inserter doesn't appear to return a minimal set. E.g. if the start point of a polygon appears in the union, it will appear twice (consecutively).
Is this expected behavior? If so, it should probably be documented. I have some other algorithms which expect a sequence of unique points, so I would need to pre-process the result of this function call.
Good question. This was a known problem, in our tests we're currently running "simplify" to remove them. It should have been documented as known problem, sorry. The intention is to return a minimal set. Instead of simplify you can also call std::unique (as in one of the samples) on the rings of the output polygons, this will help (but I agree, inconvenient now). Regards, Barend

On Sun, Nov 22, 2009 at 5:04 PM, Barend Gehrels <barend@geodan.nl> wrote:
The intention is to return a minimal set.
Yes, the documentation indicates a set, which implies unique elements (except, I guess, for the first/last point, as per the GGL "way").
Instead of simplify you can also call std::unique (as in one of the samples) on the rings of the output polygons, this will help (but I agree, inconvenient now).
Yes, it is easy enough to work around, once you know that it may be necessary. :-) Thanks! Jon
participants (2)
-
Barend Gehrels
-
Jonathan Franklin