iverase commented on issue #608: LUCENE-8620: LatLonShape contains URL: https://github.com/apache/lucene-solr/pull/608#issuecomment-472478839 This change has three main features: 1) For supporting CONTAINS, we need to add to the encoding if a triangle edge belongs to the original shape or not. This is done by using three spare bits on the encoding byte array. In order to be able to easily decode the triangle a new class `LatLonShape.Triangle` has been added and a static method in `LatLonShape` to read the encoded values. 2) The `Tessellator` has been modified to capture the information above. This required more effort that initially expected, in particular I need to add a new method that tells me if a new edge is actually belonging to the polygon. I have added several tests. 3) A new method has been added to our shapes to compute if the shape is Within the provided triangle. This method returns the Within relationship which can have three possible values: * CANDIDATE: Either the shape is inside the provided triangle or it crosses only edges that do not belong to the original shape. * NOTWITHIN: The shape crosses an edge that belongs to the original shape * DISJOINT: The shape is disjoint with the triangle. The result for a CONTAINS query will be all the shapes that has been marked as CANDIDATE removing all the shapes that has been marked as NOTWITHIN. Note that this method only support shapes with a unique component as it will required much more effort to capture that every component is actually within. Therefore when building a CONTAINS query with a multi-shape, it is translated to a boolean query. cc @nknize @jpountz
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
