roblburris opened a new issue, #15554: URL: https://github.com/apache/lucene/issues/15554
### Description Hello! We have a geometry that fails to index in the latest release of Lucene ([10.3.2](https://github.com/apache/lucene/releases/tag/releases%2Flucene%2F10.3.2)): [geometry.txt](https://github.com/user-attachments/files/24484380/geometry.txt) <img width="680" height="676" alt="Image" src="https://github.com/user-attachments/assets/dfa0cbcd-6f59-4a0a-9dbe-f8f2a0f313ff" /> In particular, we are encountering the following exception when calling LatLonShape#createIndexableFields: ``` Unable to Tessellate shape. Possible malformed shape detected. at org.apache.lucene.geo.Tessellator.earcutLinkedList(Tessellator.java:655) at org.apache.lucene.geo.Tessellator.splitEarcut(Tessellator.java:906) at org.apache.lucene.geo.Tessellator.earcutLinkedList(Tessellator.java:651) at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:139) at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:89) at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:102) at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:86) ``` This appears to be the same error seen in https://github.com/apache/lucene/issues/15205. Admittedly, I am not very familiar with the specifics of Tessellator, but I saw that Tessellator is inspired by mapbox's earcut algorithm ([xref](https://github.com/apache/lucene/blob/63fcc7d950f6ce6d9f39f0b07ae64b9abc1fc8c2/lucene/core/src/java/org/apache/lucene/geo/Tessellator.java#L34-L38)). If it helps, I ran this geometry through [earcut](https://github.com/mapbox/earcut/tree/main) and it seems to be able to produce a triangulation result: https://jsfiddle.net/w6k5p9zx/1/ For the future, would it be possible to introduce some sort of “best effort tessellation” flag that allows indexing to succeed even if the resulting queries may be inaccurate? This appears to be what earcut does in returning early instead of completing exceptionally. As is, the current behavior of throwing an exception during indexing is quite catastrophic and prevents us from indexing valid geometries. Alternatively, if there’s a way to change the Tessellation implementation to not throw exceptions, that would be greatly appreciated and would help a lot in preventing these sorts of issues. Thank you! ### Version and environment details Lucene 10.3.2 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
