Katana VentraIP

Z-order curve

In mathematical analysis and computer science, functions which are Z-order, Lebesgue curve, Morton space-filling curve,[1] Morton order or Morton code map multidimensional data to one dimension while preserving locality of the data points. It is named in France after Henri Lebesgue, who studied it in 1904,[2] and named in the United States after Guy Macdonald Morton, who first applied the order to file sequencing in 1966.[3] The z-value of a point in multidimensions is simply calculated by interleaving the binary representations of its coordinate values. Once the data are sorted into this ordering, any one-dimensional data structure can be used, such as simple one dimensional arrays, binary search trees, B-trees, skip lists or (with low significant bits truncated) hash tables. The resulting ordering can equivalently be described as the order one would get from a depth-first traversal of a quadtree or octree.

Not to be confused with Z curve or Z-order.

Related structures[edit]

As an alternative, the Hilbert curve has been suggested as it has a better order-preserving behaviour,[5] and, in fact, was used in an optimized index, the S2-geometry.[15]

Geohash

Hilbert R-tree

Linear algebra

Locality preserving hashing

Matrix representation

Netto's theorem

PH-tree

Spatial index

STANN: A library for approximate nearest neighbor search, using Z-order curve

Sean Eron Anderson, Stanford University

Methods for programming bit interleaving