Subject: [Boost-bugs] [Boost C++ Libraries] #12663: geometry::equals fails when points differ by small value
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-08 20:21:07
#12663: geometry::equals fails when points differ by small value
------------------------------+---------------------------
Reporter: anonymous | Owner: barendgehrels
Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.61.0 | Severity: Problem
Keywords: equals |
------------------------------+---------------------------
It seems the geometry::equals function is very strict when dealing w/
floating point precision. I have 2 polygons that are the same except for
one point (15.0, 10.0) vs (14.9999999999, 10.0), but geometry::equals
returns false. I don't know if this is a bug or the expected behavior.
What is the tolerance and is there a way to specify it?
bg_polygon polygon1;
boost::geometry::read_wkt("POLYGON((10.0 10.0, 10.0 20.0, 15.0 20.0,
14.9999999999 10.0, 10.0 10.0))", polygon1);
bg_polygon polygon2;
boost::geometry::read_wkt("POLYGON((10.0 10.0, 10.0 20.0, 15.0 20.0, 15.0
10.0, 10.0 10.0))", polygon2);
boost::geometry::equals(polygon1, polygon2); --> returns false
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12663> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC