Skip to content

Commit

Permalink
Improve point testing performance
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Apr 25, 2024
1 parent 704a7ea commit ca49cd4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,19 @@ public boolean compute(TopologyPredicate predicate, Geometry inputB) {

TopologyComputer topoComputer = new TopologyComputer(predicate, geomA, geomB);

//-- optimize P/P evaluation
//-- optimized P/P evaluation
if (dimA == Dimension.P && dimB == Dimension.P) {
computePP(geomB, topoComputer);
topoComputer.finish();
return topoComputer.getResult();
}

computeAtPoints(geomA, GEOM_A, geomB, topoComputer);
//-- test points against (potentially) indexed geometry first
computeAtPoints(geomB, GEOM_B, geomA, topoComputer);
if (topoComputer.isResultKnown()) {
return topoComputer.getResult();
}
computeAtPoints(geomB, GEOM_B, geomA, topoComputer);
computeAtPoints(geomA, GEOM_A, geomB, topoComputer);
if (topoComputer.isResultKnown()) {
return topoComputer.getResult();
}
Expand Down

0 comments on commit ca49cd4

Please sign in to comment.