Class GeoShapeIndexer

    • Field Detail

      • INTERSECTION_ORDER

        protected static final Comparator<org.elasticsearch.index.mapper.GeoShapeIndexer.Edge> INTERSECTION_ORDER
    • Constructor Detail

      • GeoShapeIndexer

        public GeoShapeIndexer​(boolean orientation,
                               String name)
    • Method Detail

      • intersection

        protected static double intersection​(double p1x,
                                             double p2x,
                                             double dateline)
        Calculate the intersection of a line segment and a vertical dateline.
        Parameters:
        p1x - longitude of the start-point of the line segment
        p2x - longitude of the end-point of the line segment
        dateline - x-coordinate of the vertical dateline
        Returns:
        position of the intersection in the open range (0..1] if the line segment intersects with the line segment. Otherwise this method returns Double.NaN
      • shift

        protected static Point shift​(Point coordinate,
                                     double dateline)
      • position

        protected static Point position​(Point p1,
                                        Point p2,
                                        double position)
      • intersections

        protected static int intersections​(double dateline,
                                           org.elasticsearch.index.mapper.GeoShapeIndexer.Edge[] edges)
        Calculate all intersections of line segments and a vertical line. The Array of edges will be ordered asc by the y-coordinate of the intersections of edges.
        Parameters:
        dateline - x-coordinate of the dateline
        edges - set of edges that may intersect with the dateline
        Returns:
        number of intersecting edges
      • toLucenePolygon

        public static Polygon toLucenePolygon​(Polygon polygon)