java.lang.Object
org.opensearch.geo.search.aggregations.bucket.geogrid.util.GeoShapeHashUtil

public class GeoShapeHashUtil extends Object
We have a Geohash class present at the libs level, not using that because while encoding the shapes we need GeoShapeDocValue. This class provided the utilities encode the shape as GeoHashes
  • Constructor Details

    • GeoShapeHashUtil

      public GeoShapeHashUtil()
  • Method Details

    • encodeShape

      public static List<Long> encodeShape(GeoShapeDocValue geoShapeDocValue, int precision)
      The function encodes the shape provided as GeoShapeDocValue to a List of Long values (representing the GeoHashes) which are intersecting with the shapes at a given precision.
      Parameters:
      geoShapeDocValue - GeoShapeDocValue
      precision - int
      Returns:
      List containing encoded Long values