- GeoSeries.morton_distance(total_bounds=None, level=16)#
Calculate the distance of geometries along the Morton curve
The Morton curve is also known as Z-order https://en.wikipedia.org/wiki/Z-order.
The Morton distance can be used to spatially partition Dask-GeoPandas objects, by mapping two-dimensional geometries along the Morton space-filing curve.
Each geometry is represented by the midpoint of its bounds and linked to the Morton curve. The function returns a distance from the beginning of the curve to the linked point.
Morton distance is more performant than
hilbert_distancebut can result in less optimal partitioning.
- total_bounds4-element array, optional
The spatial extent in which the curve is constructed (used to rescale the geometry midpoints). By default, the total bounds of the full dask GeoDataFrame will be computed (from the spatial partitions, if available, otherwise computed from the full dataframe). If known, you can pass the total bounds to avoid this extra computation.
- levelint (1 - 16), default 16
Determines the precision of the Morton curve.
Series containing distances along the Morton curve