iverase commented on a change in pull request #726: LUCENE-8632: New XYShape 
Field and Queries for indexing and searching general cartesian geometries
URL: https://github.com/apache/lucene-solr/pull/726#discussion_r299802571
 
 

 ##########
 File path: lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
 ##########
 @@ -142,6 +183,27 @@ private static final Node createDoublyLinkedList(final 
Polygon polygon, int star
     return filterPoints(lastNode, null);
   }
 
+  private static final Node eliminateHoles(final XYPolygon polygon, Node 
outerNode) {
+    // Define a list to hole a reference to each filtered hole list.
+    final List<Node> holeList = new ArrayList<>();
+    // keep a reference to the hole
+    final Map<Node, XYPolygon> holeListPolygons = new HashMap<>();
+    // Iterate through each array of hole vertices.
+    XYPolygon[] holes = polygon.getHoles();
+    int nodeIndex = polygon.numPoints() ;
+    for(int i = 0; i < polygon.numHoles(); ++i) {
+      // create the doubly-linked hole list
+      Node list = createDoublyLinkedList(holes[i].getPolyX(), 
holes[i].getPolyY(), holes[i].getWindingOrder(), false, nodeIndex, 
WindingOrder.CCW);
+      // Determine if the resulting hole polygon was successful.
+      if(list != null) {
+        // Add the leftmost vertex of the hole.
+        holeList.add(fetchLeftmost(list));
+      }
 
 Review comment:
   You need to populate here `holeListPolygons` or you get an NPE downstream

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to