Class GeoShapeIndexer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.Comparator<org.elasticsearch.index.mapper.GeoShapeIndexer.Edge> INTERSECTION_ORDER  
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoShapeIndexer​(boolean orientation, java.lang.String name)  
    • Method Summary

      Modifier and Type Method Description
      java.util.List<org.apache.lucene.index.IndexableField> indexShape​(ParseContext context, Geometry shape)  
      protected static double intersection​(double p1x, double p2x, double dateline)
      Calculate the intersection of a line segment and a vertical dateline.
      protected static int intersections​(double dateline, org.elasticsearch.index.mapper.GeoShapeIndexer.Edge[] edges)
      Calculate all intersections of line segments and a vertical line.
      protected static Point position​(Point p1, Point p2, double position)  
      Geometry prepareForIndexing​(Geometry geometry)  
      java.lang.Class<Geometry> processedClass()  
      protected static Point shift​(Point coordinate, double dateline)  
      static org.apache.lucene.geo.Polygon toLucenePolygon​(Polygon polygon)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INTERSECTION_ORDER

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

      • GeoShapeIndexer

        public GeoShapeIndexer​(boolean orientation,
                               java.lang.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 org.apache.lucene.geo.Polygon toLucenePolygon​(Polygon polygon)