> ## 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 (Python)

> A space filling curve function that generates a XZ2 value from a geometry.

A space filling curve function that generates a XZ2 value from a geometry.
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. The precision parameter is used to control the number of bits used in the XZ2 value.
Larger values take longer to compute but provide more precision.

SQL reference: [`ST_XZ2`](/reference/wherobots-db/geometry-data/spatial-indexing/ST_XZ2)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_XZ2

ST_XZ2(geometry: ColumnOrName, precision: Union[ColumnOrName, int] = None) -> Column
```

## Parameters

<ParamField path="geometry" type="ColumnOrName" required>
  Geometry column to  retrieve the XZ2 value of.
</ParamField>

<ParamField path="precision" type="Union[ColumnOrName, int]" default="None">
  The precision of the XZ2 value to generate.
</ParamField>

## Returns

<ResponseField name="return" type="long">
  A numeric index (a long integer) representing the XZ2 value.
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.