|
Geometry : |
Subject: [geometry] boost::geometry::equals
From: shalabuda (shalabuda_at_[hidden])
Date: 2014-02-18 13:14:22
Hi,
Could you help me figure out the following weird behavior of
boost::geometry::equals?
The first cout in the following piece of code returns 1, but the second one
is 0.
boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double>>
p1, p2;
boost::geometry::model::ring<boost::geometry::model::d2::point_xy<double>>
r1, r2;
boost::geometry::read_wkt("POLYGON((1 1, 2 2, 3 -1, 1 1))", p1);
boost::geometry::read_wkt("POLYGON((2 2, 3 -1, 1 1, 2 2))", r1);
boost::geometry::correct(p1);
boost::geometry::correct(r1);
std::cout << boost::geometry::equals(p1, r1) << std::endl;
boost::geometry::read_wkt("POLYGON((9.65421 -0.776658, 9.1545 0.0888657,
9.82324 0.83158, 9.65421 -0.776658))", p2);
boost::geometry::read_wkt("POLYGON((9.1545 0.0888657, 9.82324 0.83158,
9.65421 -0.776658, 9.1545 0.0888657))", r2);
boost::geometry::correct(p2);
boost::geometry::correct(r2);
std::cout << boost::geometry::equals(p2, r2) << std::endl;
-- View this message in context: http://boost-geometry.203548.n3.nabble.com/boost-geometry-equals-tp4025858.html Sent from the Boost Geometry mailing list archive at Nabble.com.
Geometry list run by mateusz at loskot.net