jpountz commented on a change in pull request #546: LUCENE-8620: LatLonShape
contains
URL: https://github.com/apache/lucene-solr/pull/546#discussion_r250104177
##########
File path: lucene/core/src/java/org/apache/lucene/geo/EdgeTree.java
##########
@@ -101,6 +101,60 @@ public Relation relateTriangle(double ax, double ay,
double bx, double by, doubl
return Relation.CELL_OUTSIDE_QUERY;
}
+ /** Used by withinTriangle to check the within relationship between a
triangle and the query shape */
+ public enum WithinRelation {
+ /** If the shape is a candidate for within. Typically this is return if
the query shape is fully inside
+ * the triangle or if the query shape intersects only edges that do not
belong to the original shape. */
+ CANDIDATE,
+ /** Return this if if the query shape intersects an edge that does belong
to the original shape. */
+ CROSSES,
+ /** Return this if the query shape is disjoint with the triangle. Note
that the query shape can still be
+ * within the indexed shape that correspond to the triangle */
+ DISJOINT
+ }
+
+ /**
+ * Checks if the shape is within the provided triangle.
+ *
+ * @param ax longitude of point a of the triangle
+ * @param ay latitude of point a of the triangle
+ * @param ab if edge ab belongs to the original shape
+ * @param bx longitude of point b of the triangle
+ * @param by latitude of point b of the triangle
+ * @param bc if edge bc belongs to the original shape
+ * @param cx longitude of point c of the triangle
+ * @param cy latitude of point c of the triangle
+ * @param ca if edge ca belongs to the original shape
+ * @return
Review comment:
let's either have it in the javadocs with a description or remove it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]