{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "st_geohex",
  "license" : "PLATINUM",
  "description" : "Calculates the `geohex`, the H3 cell-id, of the supplied geo_point at the specified precision.\nThe result is long encoded. Use ST_GEOHEX_TO_STRING to convert the result to a string.\n\nThese functions are related to the `geo_grid` query\nand the `geohex_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 [0 and 15](https://h3geo.org/docs/core-library/restable/)."
        }
      ],
      "license" : "PLATINUM",
      "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 [0 and 15](https://h3geo.org/docs/core-library/restable/)."
        },
        {
          "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."
        }
      ],
      "license" : "PLATINUM",
      "variadic" : false,
      "returnType" : "long"
    }
  ],
  "examples" : [
    "FROM airports\n| EVAL geohex = ST_GEOHEX(location, 1)\n| STATS\n    count = COUNT(*),\n    centroid = ST_CENTROID_AGG(location)\n      BY geohex\n| WHERE count >= 10\n| EVAL geohexString = ST_GEOHEX_TO_STRING(geohex)\n| KEEP count, centroid, geohexString\n| SORT count DESC, geohexString ASC"
  ],
  "preview" : true,
  "snapshot_only" : true
}