Boost logo

Geometry :

Subject: [geometry] Incorrect results from bg::equals (problem with closure and collect_vectors?)
From: Ch'Gans (chgans_at_[hidden])
Date: 2017-04-08 14:14:50


Hi there,

My custom ring type is defined with an 'open' closure.

When i try to compare 2 geometrically equivalent ring and box,
bg::equals return false.
While investigating using the debugger, i discovered that the call to
geometry::collect_vectors() returns 4 points for a box, but only 3
points for a ring, so my 2 geometries can never be equal.

In my case, collect_vectors is dispatched to range_collect_vectors,
and by the look of it range_collect_vectors doesn't care about the
geometry object (and it's closure), since it sees only point
(iterator) range.

I found a similar thread back from 2014, but it actually deals with a
different problem, see
http://boost-geometry.203548.n3.nabble.com/Possible-bug-in-boost-geometry-equals-td4025819.html.

And there is this bug report that seems to be equivalent to my use-case:
https://svn.boost.org/trac/boost/ticket/11899

Am i missing something in my custom geometry trait adaptation? is it a
bug in BG, or a known limitation?

Could someone shed some light on this? Any point-out to example,
documentation or archives would be welcome too.

If this is the same bug as #11899, could the fix be as simple as
making range_collect_vectors aware of the closure of the ring, or
maybe simply add a specialisation for rings?

Thanks,
Chris


Geometry list run by mateusz at loskot.net