From 00c98da08487ca93a1951f50dd41f344402046d2 Mon Sep 17 00:00:00 2001 From: Benoit Maurin Date: Mon, 13 Jan 2025 17:59:31 +0100 Subject: [PATCH 1/2] Fix inscribed circle initialization --- src/algorithm/construct/MaximumInscribedCircle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithm/construct/MaximumInscribedCircle.cpp b/src/algorithm/construct/MaximumInscribedCircle.cpp index c3a4710784..89c910d3b7 100644 --- a/src/algorithm/construct/MaximumInscribedCircle.cpp +++ b/src/algorithm/construct/MaximumInscribedCircle.cpp @@ -164,8 +164,8 @@ MaximumInscribedCircle::distanceToBoundary(double x, double y) MaximumInscribedCircle::Cell MaximumInscribedCircle::createInteriorPointCell(const Geometry* geom) { - Coordinate c; std::unique_ptr p = geom->getInteriorPoint(); + Coordinate c(p->getX(), p->getY()); Cell cell(p->getX(), p->getY(), 0, distanceToBoundary(c)); return cell; } From 63fb272cffe8dcf28864925e12f0e8eb981faa9d Mon Sep 17 00:00:00 2001 From: Benoit Maurin Date: Mon, 13 Jan 2025 19:20:44 +0100 Subject: [PATCH 2/2] Fix tests --- tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp b/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp index be67b9a2e6..9818b8b92b 100644 --- a/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp +++ b/tests/unit/algorithm/construct/MaximumInscribedCircleTest.cpp @@ -173,7 +173,7 @@ void object::test<5> () { checkCircle("POLYGON ((100 100, 200 200, 100 100, 100 100))", - 0.01, 150, 150, 0 ); + 0.01, 100, 100, 0 ); } @@ -198,7 +198,7 @@ void object::test<7> () { checkCircle("POLYGON((1 2, 1 2, 1 2, 1 2, 3 2, 1 2))", - 0.01, 2, 2, 0 ); + 0.01, 1, 2, 0 ); } // Exception thrown to avoid infinite loop with infinite envelope