Package org.opensearch.common.geo
Class GeoShapeDocValue
java.lang.Object
org.opensearch.common.geo.ShapeDocValue
org.opensearch.common.geo.GeoShapeDocValue
This class is an OpenSearch Internal representation of lucene
LatLonShapeDocValuesField
for GeoShape.- Opensearch.internal:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
An extension forShapeDocValue.BoundingRectangle
which make easy to read the values when BB is on the EarthSurfacestatic final class
An extension forShapeDocValue.Centroid
which make easy to read the values when centroid is on the EarthSurfaceNested classes/interfaces inherited from class org.opensearch.common.geo.ShapeDocValue
ShapeDocValue.ShapeType
-
Field Summary
Fields inherited from class org.opensearch.common.geo.ShapeDocValue
boundingRectangle, centroid, highestDimensionType
-
Constructor Summary
ConstructorDescriptionGeoShapeDocValue
(String fieldName, org.apache.lucene.util.BytesRef bytesRef) GeoShapeDocValue
(org.apache.lucene.document.LatLonShapeDocValuesField shapeDocValuesField) -
Method Summary
Modifier and TypeMethodDescriptionstatic GeoShapeDocValue
createGeometryDocValue
(org.opensearch.geometry.Geometry geometry) This function takes aGeometry
and creates theGeoShapeDocValue
.boolean
int
hashCode()
boolean
isIntersectingRectangle
(org.opensearch.geometry.Rectangle rectangle) Checks if the inputRectangle
is intersecting with the shape represented asGeoShapeDocValue
.toString()
Methods inherited from class org.opensearch.common.geo.ShapeDocValue
getHighestDimensionType
-
Constructor Details
-
GeoShapeDocValue
-
GeoShapeDocValue
public GeoShapeDocValue(org.apache.lucene.document.LatLonShapeDocValuesField shapeDocValuesField)
-
-
Method Details
-
createGeometryDocValue
This function takes aGeometry
and creates theGeoShapeDocValue
. The function uses theGeoShapeIndexer
to first convert theGeometry
toIndexableField
s 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 toIndexableField
s as it does the Tessellation internally which is already done on theIndexableField
s.- Parameters:
geometry
-Geometry
- Returns:
GeoShapeDocValue
-
getCentroid
- Overrides:
getCentroid
in classShapeDocValue
-
getBoundingRectangle
- Overrides:
getBoundingRectangle
in classShapeDocValue
-
toString
-
equals
-
hashCode
public int hashCode() -
isIntersectingRectangle
public boolean isIntersectingRectangle(org.opensearch.geometry.Rectangle rectangle) Checks if the inputRectangle
is intersecting with the shape represented asGeoShapeDocValue
. We could have used theGeometryVisitor
here and added the functionality to check the intersection with otherGeometry
also, but that will be an overkill for now, if required we can easily create aGeometryVisitor
to check the intersection with this Shape represented asGeoShapeDocValue
.- Returns:
- boolean
-