|
Geometry : |
Subject: [geometry] Dissolve ... exception
From: Johan Doré (jdh_at_[hidden])
Date: 2018-08-19 14:57:37
Dear Boost Geometry
One of our customers experienced a crash which I was able to trance down to a non-std::exception thrown when using the dissolve function with version 1.66.
In addition I see the same error when I download your latest Developer Branch from GitHub and put it on top of Boost Version 1.66
I therefore implemented a test case for you reproducing the error:
BOOST_AUTO_TEST_CASE(Boost_Dissolve_ThowsException)
{
polygon<point_xy<float>> Poly;
read_wkt("POLYGON((13.78 -2.18,"
" 7.04 -2.33,"
" 7.08 -2.33,"
"16.05 -0.55,"
"16.46 -6.08,"
"16.99 -5.82,"
" 2.92 -1.99,"
"15.14 -1.65,"
"17.41 -4.42,"
"13.78 -2.18))", Poly);
multi_polygon<polygon<point_xy<float>>> Result;
int Catched = 0;
try
{
boost::geometry::dissolve(Poly, Result);
}
catch (const std::exception& /*ex*/)
{
Catched = 1;
}
catch (...)
{
Catched = 2;
}
BOOST_CHECK(Catched == 2);
}
When I run this using Visual C++ 2013 with C++ Exceptions set to âYes with SHE Exceptions (/EHa)â I can catch the error in the catch(â¦) statement.
In addition I get the following info in the debug output:
1> Assertion failed: id.ring_index >= -1 && id.ring_index < int(boost::size(interior_rings(polygon))), file c:\program files (x86)\boost\boost_1_66_0\boost\geometry\algorithms\detail\overlay\get_ring.hpp, line 89
I hope you can use this to make this great library even better.
Thanks a lot
Johan Doré
CTO, Vice President
Agern Allé 24
2970 Hørsholm
Denmark
Mobile: +45 40 53 93 21
Direct: +45 88 20 20 80
www.visiopharm.com<http://www.visiopharm.com>
Geometry list run by mateusz at loskot.net