# Geometry :

Subject: [ggl] Buggy polygon difference case
From: Barend Gehrels (barend)
Date: 2011-09-20 22:09:10

Hi Pal,

>
>
> I isolated a case of two polygons where the output of
> boost::geometry::difference seems to be incorect. We compute the
> difference of
> "MULTIPOLYGON(((18000 18000,18000 -18000,-18000 -18000,-18000
> 18000,18000 18000),(18000 18000,15928 1521,16000 0,18000 18000)))"
> and
> "MULTIPOLYGON(((15711 3028,18000 18000,15928 1521,15711 3028)))".
> The answer produced by boost is
> "MULTIPOLYGON(((15928 1521,16000 0,18000 18000,15711 3028,15928 1521)))"
> which is definitely wrong. The first polygon has a single outer and a
> single inner loop, touching the outer loop in a vertex. The second
> polygon is a triangle touching the inner loop if the first one in an
> edge, as well as the outer loop of the first one in a vertex.
>
> I do not think that precision of the number type has a role, as the
> input has only integers, and no nontrivial intersections can be
> computed from the input data. The other thing I am not sure in, is the
> correctness of the representation of the first polygon. It could be
> given also by a single self-intersecting outer loop. However, this was
> extracted from the result of another boost geometry boolean operation,
> so it should entirely satisfy the corresponding boost concepts.
>
> Is that a bug, or how should I tweak my code to result a correct answer?
>

Thanks for the report.

I did have a quick look and can reproduce your problem. However, I
cannot dive deeper into this at this moment, so that will be beginning
of October, sorry for the inconvenience.

Regards, Barend

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20110920/665dfdf5/attachment.html

Geometry list run by mateusz at loskot.net