{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "st_geohash",
  "description" : "Calculates the `geohash` of the supplied geo_point at the specified precision.\nThe result is long encoded. Use ST_GEOHASH_TO_STRING to convert the result to a string.\n\nThese functions are related to the `geo_grid` query\nand the `geohash_grid` aggregation.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "geometry",
          "type" : "geo_point",
          "optional" : false,
          "description" : "Expression of type `geo_point`. If `null`, the function returns `null`."
        },
        {
          "name" : "precision",
          "type" : "integer",
          "optional" : false,
          "description" : "Expression of type `integer`. If `null`, the function returns `null`. Valid values are between [1 and 12](https://en.wikipedia.org/wiki/Geohash)."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "geometry",
          "type" : "geo_point",
          "optional" : false,
          "description" : "Expression of type `geo_point`. If `null`, the function returns `null`."
        },
        {
          "name" : "precision",
          "type" : "integer",
          "optional" : false,
          "description" : "Expression of type `integer`. If `null`, the function returns `null`. Valid values are between [1 and 12](https://en.wikipedia.org/wiki/Geohash)."
        },
        {
          "name" : "bounds",
          "type" : "geo_shape",
          "optional" : true,
          "description" : "Optional bounds to filter the grid tiles, a `geo_shape` of type `BBOX`. Use [`ST_ENVELOPE`](#esql-st_envelope) if the `geo_shape` is of any other type."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    }
  ],
  "examples" : [
    "FROM airports\n| EVAL geohash = ST_GEOHASH(location, 1)\n| STATS\n    count = COUNT(*),\n    centroid = ST_CENTROID_AGG(location)\n      BY geohash\n| WHERE count >= 10\n| EVAL geohashString = ST_GEOHASH_TO_STRING(geohash)\n| KEEP count, centroid, geohashString\n| SORT count DESC, geohashString ASC"
  ],
  "preview" : true,
  "snapshot_only" : true
}