Skip to content

Commit

Permalink
Avoid indexing polygon shell if we have no holes to test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Dec 5, 2019
1 parent 667f220 commit 767cb5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/operation/valid/IsValidOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,16 @@ IsValidOp::checkNoSelfIntersectingRing(EdgeIntersectionList& eiList)
void
IsValidOp::checkHolesInShell(const Polygon* p, GeometryGraph* graph)
{
auto nholes = p->getNumInteriorRing();
if (nholes == 0) {
return;
}

const LinearRing* shell = p->getExteriorRing();

bool isShellEmpty = shell->isEmpty();

locate::IndexedPointInAreaLocator ipial(*shell);
auto nholes = p->getNumInteriorRing();

for(size_t i = 0; i < nholes; ++i) {
const LinearRing* hole = p->getInteriorRingN(i);
Expand Down

0 comments on commit 767cb5f

Please sign in to comment.