> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_XZ2

Returns the numeric index (a long integer) representing the XZ2 value.

Only supports data in lon/lat format. XZ2 is a 2D space filling curve that is used to index 2D data. Compared
to a GeoHash, it provides improved sorting for non-point data that takes into account the bounding box of
the geometry.

## Signatures

```sql theme={"system"}
ST_XZ2(geom: Geometry, precision: Integer)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="precision" type="Integer" required>
  The number of decimal places.
</ParamField>

## Return type

<ResponseField type="Long">
  The numeric XZ2 index value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_XZ2(ST_GeomFromText('POLYGON ((-1 -11, 0 10, 1 11, 2 12, -1 -11))'), 6)
```

```
1281
```
