Class LuceneGeometriesUtils

java.lang.Object
org.elasticsearch.common.geo.LuceneGeometriesUtils

public class LuceneGeometriesUtils extends Object
  • Method Details

    • toLatLonGeometry

      public static org.apache.lucene.geo.LatLonGeometry[] toLatLonGeometry(Geometry geometry, boolean quantize, Consumer<ShapeType> checker)
      Transform an Elasticsearch Geometry into a lucene LatLonGeometry
      Parameters:
      geometry - the geometry to transform
      quantize - if true, the coordinates of the geometry will be quantized using lucene quantization. This is useful for queries so the latitude and longitude values to match the values on the index.
      checker - call for every ShapeType found in the Geometry. It allows to throw an error if a geometry is not supported.
      Returns:
      an array of LatLonGeometry
    • toLatLonPoint

      public static org.apache.lucene.geo.Point toLatLonPoint(Point point)
      Transform an Elasticsearch Point into a lucene Point
    • toLatLonLine

      public static org.apache.lucene.geo.Line toLatLonLine(Line line)
      Transform an Elasticsearch Line into a lucene Line
    • toLatLonPolygon

      public static org.apache.lucene.geo.Polygon toLatLonPolygon(Polygon polygon)
      Transform an Elasticsearch Polygon into a lucene Polygon
    • toLatLonRectangle

      public static org.apache.lucene.geo.Rectangle toLatLonRectangle(Rectangle rectangle)
      Transform an Elasticsearch Rectangle into a lucene Rectangle
    • toLatLonCircle

      public static org.apache.lucene.geo.Circle toLatLonCircle(Circle circle)
      Transform an Elasticsearch Circle into a lucene Circle
    • toXYGeometry

      public static org.apache.lucene.geo.XYGeometry[] toXYGeometry(Geometry geometry, Consumer<ShapeType> checker)
      Transform an Elasticsearch Geometry into a lucene XYGeometry
      Parameters:
      geometry - the geometry to transform.
      checker - call for every ShapeType found in the Geometry. It allows to throw an error if a geometry is not supported.
      Returns:
      an array of XYGeometry
    • toXYPoint

      public static org.apache.lucene.geo.XYPoint toXYPoint(Point point)
      Transform an Elasticsearch Point into a lucene XYPoint
    • toXYLine

      public static org.apache.lucene.geo.XYLine toXYLine(Line line)
      Transform an Elasticsearch Line into a lucene XYLine
    • toXYPolygon

      public static org.apache.lucene.geo.XYPolygon toXYPolygon(Polygon polygon)
      Transform an Elasticsearch Polygon into a lucene XYPolygon
    • toXYRectangle

      public static org.apache.lucene.geo.XYRectangle toXYRectangle(Rectangle r)
      Transform an Elasticsearch Rectangle into a lucene XYRectangle
    • toXYCircle

      public static org.apache.lucene.geo.XYCircle toXYCircle(Circle circle)
      Transform an Elasticsearch Circle into a lucene XYCircle