From 3dd33f99ff8f3134ba8e418ec7b7c5d2d8672814 Mon Sep 17 00:00:00 2001 From: strk Date: Sat, 29 Mar 2014 10:44:53 +0000 Subject: [PATCH] Polygonizer: do not pretend all exceptions are due to edge invalidity git-svn-id: http://svn.osgeo.org/geos/branches/3.4@3980 5242fede-7e19-0410-aef8-94bd7d2200fb --- NEWS | 1 + src/operation/polygonize/EdgeRing.cpp | 3 ++- src/operation/polygonize/Polygonizer.cpp | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 92d489e5..9a5be8d6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ YYYY-MM-DD - Fix build on HP-UX 11.23 (#664) - Throw a ParseException on missing chars from HEXWKB string (#675) - Fix ruby binding build (https://github.com/libgeos/libgeos/pull/32) + - Make polygonize operation interruptable Changes in 3.4.2 2013-08-25 diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp index 129fa0fb..ee1537f4 100644 --- a/src/operation/polygonize/EdgeRing.cpp +++ b/src/operation/polygonize/EdgeRing.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -225,7 +226,7 @@ EdgeRing::getRingInternal() getCoordinates(); try { ring=factory->createLinearRing(*ringPts); - } catch (const std::exception& e) { + } catch (const geos::util::IllegalArgumentException& e) { #if GEOS_DEBUG // FIXME: print also ringPts std::cerr << "EdgeRing::getRingInternal: " diff --git a/src/operation/polygonize/Polygonizer.cpp b/src/operation/polygonize/Polygonizer.cpp index fdfc1d3f..024b9270 100644 --- a/src/operation/polygonize/Polygonizer.cpp +++ b/src/operation/polygonize/Polygonizer.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // std #include @@ -266,6 +267,7 @@ Polygonizer::findValidRings(const vector& edgeRingList, // returned LineString ownership is transferred. invalidRingList.push_back(er->getLineString()); } + GEOS_CHECK_FOR_INTERRUPTS(); } } @@ -282,6 +284,7 @@ Polygonizer::findShellsAndHoles(const vector& edgeRingList) holeList.push_back(er); else shellList.push_back(er); + GEOS_CHECK_FOR_INTERRUPTS(); } } @@ -293,6 +296,7 @@ Polygonizer::assignHolesToShells(const vector& holeList, vector