Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ Bug Fixes

* GITHUB#15702: Fix Potential NullPointException in BytesRefHash initialization#15702 (tyronecai)

* GITHUB#15731: Fix tessellator failure when a hole is touching another hole in the middle of a segment. In this case
we might fail to detect it and choose a wrong bridge to eliminate the hole. (Ignacio Vera)

Other
---------------------
* GITHUB#15586: Document that scoring and ranking may change across major Lucene versions, and that applications requiring stable ranking should explicitly configure Similarity. (Parveen Saini)
Expand Down
8 changes: 5 additions & 3 deletions lucene/core/src/java/org/apache/lucene/geo/Tessellator.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ private static Node eliminateHole(
// compute if the bridge overlaps with a polygon edge.
boolean fromPolygon =
isPointInLine(bridge, bridge.next, holeNode)
|| isPointInLine(holeNode, holeNode.next, bridge);
|| isPointInLine(bridge, bridge.previous, holeNode)
|| isPointInLine(holeNode, holeNode.next, bridge)
|| isPointInLine(holeNode, holeNode.previous, bridge);
// Split the resulting polygon.
splitPolygon(bridge, holeNode, fromPolygon);
return outerNode;
Expand Down Expand Up @@ -1260,8 +1262,8 @@ && area(a.getX(), a.getY(), a.previous.getX(), a.previous.getY(), b.getX(), b.ge
>= 0;
} else {
// ccw
return area(a.getX(), a.getY(), b.getX(), b.getY(), a.previous.getX(), a.previous.getY()) < 0
|| area(a.getX(), a.getY(), a.next.getX(), a.next.getY(), b.getX(), b.getY()) < 0;
return area(a.getX(), a.getY(), b.getX(), b.getY(), a.previous.getX(), a.previous.getY()) <= 0
|| area(a.getX(), a.getY(), a.next.getX(), a.next.getY(), b.getX(), b.getY()) <= 0;
}
}

Expand Down
10 changes: 8 additions & 2 deletions lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java
Original file line number Diff line number Diff line change
Expand Up @@ -938,13 +938,19 @@ public void testComplexPolygon61() throws Exception {
public void testComplexPolygon62() throws Exception {
String geoJson = GeoTestUtil.readShape("github-15657.geojson.gz");
Polygon[] polygons = Polygon.fromGeoJSON(geoJson);
checkMultiPolygon(polygons, 1e-11);
checkMultiPolygon(polygons, 0.0);
}

public void testComplexPolygon63() throws Exception {
String geoJson = GeoTestUtil.readShape("github-15695.geojson.gz");
Polygon[] polygons = Polygon.fromGeoJSON(geoJson);
checkMultiPolygon(polygons, 1e-11);
checkMultiPolygon(polygons, 0.0);
}

public void testComplexPolygon64() throws Exception {
String geoJson = GeoTestUtil.readShape("github-15731.geojson.gz");
Polygon[] polygons = Polygon.fromGeoJSON(geoJson);
checkMultiPolygon(polygons, 0.0);
}

private static class TestCountingMonitor implements Tessellator.Monitor {
Expand Down
Binary file not shown.
Loading