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

> Map a geometry-envelope midpoint to a Hilbert curve distance.

Map a geometry-envelope midpoint to a Hilbert curve distance.

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

## Signature

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

ST_HilbertDistance(
    geometry: ColumnOrName,
    min_x: ColumnOrNameOrNumber,
    min_y: ColumnOrNameOrNumber,
    max_x: ColumnOrNameOrNumber,
    max_y: ColumnOrNameOrNumber,
    level: Union[ColumnOrName, int],
) -> Column
```

## Parameters

<ParamField path="geometry" type="ColumnOrName" required>
  Geometry whose envelope midpoint is encoded.
</ParamField>

<ParamField path="min_x" type="ColumnOrNameOrNumber" required>
  Minimum X of the Hilbert curve extent.
</ParamField>

<ParamField path="min_y" type="ColumnOrNameOrNumber" required>
  Minimum Y of the Hilbert curve extent.
</ParamField>

<ParamField path="max_x" type="ColumnOrNameOrNumber" required>
  Maximum X of the Hilbert curve extent.
</ParamField>

<ParamField path="max_y" type="ColumnOrNameOrNumber" required>
  Maximum Y of the Hilbert curve extent.
</ParamField>

<ParamField path="level" type="Union[ColumnOrName, int]" required>
  Hilbert curve level, at most 16.
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Non-negative Hilbert curve distance as a long column.
</ResponseField>


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