Class XTessellator

java.lang.Object
org.apache.lucene.geo.XTessellator

public final class XTessellator extends Object
This is a copy of a newer the version of same class from Lucene, one that includes a fix not yet released by Lucene. Once lucene 8.11 is released with the fix, this class can be deleted.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    Circular Doubly-linked list used for polygon coordinates
    static final class 
    Triangle in the tessellated mesh
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    linesIntersect(double aX0, double aY0, double aX1, double aY1, double bX0, double bY0, double bX1, double bY1)
    Determines whether two line segments intersect.
    static boolean
    pointInPolygon(List<XTessellator.Triangle> tessellation, double lat, double lon)
    Brute force compute if a point is in the polygon by traversing entire triangulation todo: speed this up using either binary tree or prefix coding (filtering by bounding box of triangle)
    static boolean
    pointInTriangle(double x, double y, double ax, double ay, double bx, double by, double cx, double cy)
    compute whether the given x, y point is in a triangle; uses the winding order method
    tessellate(org.apache.lucene.geo.Polygon polygon)
     
    tessellate(org.apache.lucene.geo.XYPolygon polygon)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • tessellate

      public static List<XTessellator.Triangle> tessellate(org.apache.lucene.geo.Polygon polygon)
    • tessellate

      public static List<XTessellator.Triangle> tessellate(org.apache.lucene.geo.XYPolygon polygon)
    • linesIntersect

      public static boolean linesIntersect(double aX0, double aY0, double aX1, double aY1, double bX0, double bY0, double bX1, double bY1)
      Determines whether two line segments intersect.
    • pointInTriangle

      public static boolean pointInTriangle(double x, double y, double ax, double ay, double bx, double by, double cx, double cy)
      compute whether the given x, y point is in a triangle; uses the winding order method
    • pointInPolygon

      public static boolean pointInPolygon(List<XTessellator.Triangle> tessellation, double lat, double lon)
      Brute force compute if a point is in the polygon by traversing entire triangulation todo: speed this up using either binary tree or prefix coding (filtering by bounding box of triangle)