You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/01/22 15:14:03 UTC

[GitHub] jpountz commented on a change in pull request #546: LUCENE-8620: LatLonShape contains

jpountz commented on a change in pull request #546: LUCENE-8620: LatLonShape contains
URL: https://github.com/apache/lucene-solr/pull/546#discussion_r249809936
 
 

 ##########
 File path: lucene/sandbox/src/java/org/apache/lucene/geo/Rectangle2D.java
 ##########
 @@ -148,6 +148,90 @@ public boolean intersectsTriangle(int aX, int aY, int bX, int bY, int cX, int cY
     return false;
   }
 
+  /**
+   *  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 the {@link EdgeTree.WithinRelation}
+   */
+  public EdgeTree.WithinRelation withinTriangle(int ax, int ay, boolean ab, int bx, int by, boolean bc, int cx, int cy, boolean ca) {
+    if (this.crossesDateline() == true) {
+      //Triangles cannot cross the date line so it is always false
+      return EdgeTree.WithinRelation.INTERSECTS;
 
 Review comment:
   how do we know it's not `DISJOINT`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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