Skip to main content
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

Signature

Parameters

ColumnOrName
required
Geometry column to retrieve the XZ2 value of.
Union[ColumnOrName, int]
default:"None"
The precision of the XZ2 value to generate.

Returns

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