mirror of https://github.com/apache/lucene.git
LUCENE-7192: Catch the case where we have two points in the same poly that are not adjacent but identical.
This commit is contained in:
parent
46062fbd86
commit
02f1dacc3d
|
@ -229,9 +229,13 @@ public class GeoPolygonFactory {
|
|||
// Check if the extension of currentPath to considerPointIndex is workable
|
||||
final GeoPoint considerStartPoint = currentPath.lastPoint;
|
||||
final GeoPoint considerEndPoint = points.get(considerPointIndex);
|
||||
final int nextPointIndex = getLegalIndex(considerPointIndex + 1, points.size());
|
||||
if (!considerStartPoint.isNumericallyIdentical(considerEndPoint)) {
|
||||
// Create a plane including these two
|
||||
final Plane considerPlane = new Plane(considerStartPoint, considerEndPoint);
|
||||
|
||||
boolean isChoiceLegal = true;
|
||||
|
||||
//System.err.println(" considering "+considerStartPoint+" to "+considerEndPoint);
|
||||
if (isChoiceLegal) {
|
||||
// Consider the previous plane/point
|
||||
|
@ -281,8 +285,6 @@ public class GeoPolygonFactory {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
final int nextPointIndex = getLegalIndex(considerPointIndex + 1, points.size());
|
||||
if (isChoiceLegal) {
|
||||
// Extend the path and call ourselves recursively.
|
||||
if (considerPointIndex == startPointIndex) {
|
||||
|
@ -296,6 +298,9 @@ public class GeoPolygonFactory {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (considerPointIndex == startPointIndex) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue