Geometry :

Subject: Re: [geometry] Difference problem using boost geometry in 1.47 (Daniel Macumber)
From: Barend Gehrels (barend_at_[hidden])
Date: 2013-10-29 19:19:50

Hi Dan,

Macumber, Daniel wrote On 28-10-2013 17:27:
> Thanks Barend, sorry for cross posting to boost list on my first question, I'll stick to here now. I've looked into my problem a bit more and found that the ggl difference method was correctly making a polygon with inner loops, I was adding the extra geometry myself. However, this brings me to a few questions I don't know how to address on my own. I wanted to ask if you have any general advice on how to deal with these issues.
>
> 1) I am working in 3D and applying transformations to make my geometry 2D for polygon work. These transformations result in precision errors. One edge of the inner loop in my difference should actually have been on the edge of the outer polygon, which is why I was expecting a single outer loop polygon with a cut out. The inner loop only occurred because of precision issues. Does GGL include any functionality to edge align polygons to help with these issues?

No... if I understand you correctly we don't have anything to do that.
You mean a sort of snapping to a specified grid. Good idea, but that is
not there.

>
> 2) In the case that a polygon really does have inner loops I need to convert it into one or more polygons that do not have inner loops. Right now I am using the reverse winding to remove all inner loops from my polygon. However, I would prefer to end up with multiple, simple polygons. Does GGL have any methods to convert a polygon with inner loops into several "nice" polygons with no inner loops?
No, also that is not there. That would result in a multi-polygon which
is officially (by OGC Simple Features) invalid, because two polygons
would be located adjacently, so forming the interior (if I understand
you correctly). That is not possible and also would result in errors in
following algorithms.

Regards, Barend

Geometry list run by mateusz at loskot.net