From 8e77892443601d702071dae4336d4976d9a7564f Mon Sep 17 00:00:00 2001 From: Karl Wright Date: Wed, 11 Apr 2018 02:53:51 -0400 Subject: [PATCH] LUCENE-8245: Handle parallel planes case properly. --- .../org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java index 3c635592946..5e362f294dc 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java @@ -603,6 +603,9 @@ class GeoComplexPolygon extends GeoBasePolygon { //System.out.println(" Computing crossings between "+envelopePlane+" and ["+edge.startPoint+"->"+edge.endPoint+"]"); final GeoPoint[] unboundedIntersectionPoints = envelopePlane.findIntersections(planetModel, edge.plane); + if (unboundedIntersectionPoints == null) { + return null; + } // Go through the intersection points one at a time. Notes: // (1) So that we don't double-count, we can only include at most one point in the result per intersection. // (2) Single-solution results imply that the plane was not crossed. The only time we consider them is if the edge ends on the plane, in which case we count it as a crossing.