{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "st_geotile",
  "description" : "Calculates the `geotile` of the supplied geo_point at the specified precision.\nThe result is long encoded. Use ST_GEOTILE_TO_STRING to convert the result to a string.\n\nThese functions are related to the `geo_grid` query\nand the `geotile_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 29](https://wiki.openstreetmap.org/wiki/Zoom_levels)."
        }
      ],
      "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 29](https://wiki.openstreetmap.org/wiki/Zoom_levels)."
        },
        {
          "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 geotile = ST_GEOTILE(location, 2)\n| STATS\n    count = COUNT(*),\n    centroid = ST_CENTROID_AGG(location)\n      BY geotile\n| EVAL geotileString = ST_GEOTILE_TO_STRING(geotile)\n| SORT count DESC, geotileString ASC\n| KEEP count, centroid, geotileString"
  ],
  "preview" : true,
  "snapshot_only" : true
}