Class GeoShapeDocValue

java.lang.Object
org.opensearch.common.geo.ShapeDocValue
org.opensearch.common.geo.GeoShapeDocValue

public class GeoShapeDocValue extends ShapeDocValue
This class is an OpenSearch Internal representation of lucene LatLonShapeDocValuesField for GeoShape.
Opensearch.internal:
  • Constructor Details

    • GeoShapeDocValue

      public GeoShapeDocValue(String fieldName, org.apache.lucene.util.BytesRef bytesRef)
    • GeoShapeDocValue

      public GeoShapeDocValue(org.apache.lucene.document.LatLonShapeDocValuesField shapeDocValuesField)
  • Method Details

    • createGeometryDocValue

      public static GeoShapeDocValue createGeometryDocValue(org.opensearch.geometry.Geometry geometry)
      This function takes a Geometry and creates the GeoShapeDocValue. The function uses the GeoShapeIndexer to first convert the Geometry to IndexableFields and then convert it to the DocValue. This is very expensive function and should not be used on the Geometry Objects which are already converted to IndexableFields as it does the Tessellation internally which is already done on the IndexableFields.
      Parameters:
      geometry - Geometry
      Returns:
      GeoShapeDocValue
    • getCentroid

      public GeoShapeDocValue.Centroid getCentroid()
      Overrides:
      getCentroid in class ShapeDocValue
    • getBoundingRectangle

      public GeoShapeDocValue.BoundingRectangle getBoundingRectangle()
      Overrides:
      getBoundingRectangle in class ShapeDocValue
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isIntersectingRectangle

      public boolean isIntersectingRectangle(org.opensearch.geometry.Rectangle rectangle)
      Checks if the input Rectangle is intersecting with the shape represented as GeoShapeDocValue. We could have used the GeometryVisitor here and added the functionality to check the intersection with other Geometry also, but that will be an overkill for now, if required we can easily create a GeometryVisitor to check the intersection with this Shape represented as GeoShapeDocValue.
      Returns:
      boolean