Namespace NetTopologySuite.Shape.Fractal
Classes
HilbertCode
Encodes points as the index along finite planar Hilbert curves.
The planar Hilbert Curve is a continuous space-filling curve. In the limit the Hilbert curve has infinitely many vertices and fills the space of the unit square. A sequence of finite approximations to the infinite Hilbert curve is defined by the level number. The finite Hilbert curve at level n Hₙ contains 2ⁿ⁺¹ points. Each finite Hilbert curve defines an ordering of the points in the 2-dimensional range square containing the curve. Curves fills the range square of side 2ˡᵉᵛᵉˡ. Curve points have ordinates in the range [0, 2ˡᵉᵛᵉˡ - 1]. The index of a point along a Hilbert curve is called the Hilbert code. The code for a given point is specific to the level chosen.
This implementation represents codes using 32-bit integers. This allows levels 0 to 16 to be handled. The class supports encoding points in the range of a given level curve and decoding the point for a given code value.
The Hilbert order has the property that it tends to preserve locality. This means that codes which are near in value will have spatially proximate points. The converse is not always true - the delta between codes for nearby points is not always small. But the average delta is small enough that the Hilbert order is an effective way of linearizing space to support range queries.
HilbertCurveBuilder
Generates a LineString representing the Hilbert Curve at a given level.
KochSnowflakeBuilder
MortonCode
Encodes points as the index along the planar Morton (Z-order) curve.
The planar Morton (Z-order) curve is a continuous space-filling curve. The Morton curve defines an ordering of the points in the positive quadrant of the plane. The index of a point along the Morton curve is called the Morton code.
A sequence of subsets of the Morton curve can be defined by a level number. Each level subset occupies a square range. The curve at level n Mₙ contains 2ⁿ⁺¹ points. It fills the range square of side 2ˡᵉᵛᵉˡ. Curve points have ordinates in the range [0, 2ˡᵉᵛᵉˡ - 1]. The code for a given point is identical at all levels. The level simply determines the number of points in the curve subset and the size of the range square.
This implementation represents codes using 32-bit integers. This allows levels 0 to 16 to be handled. The class supports encoding points and decoding the point for a given code value.
The Morton order has the property that it tends to preserve locality. This means that codes which are near in value will have spatially proximate points. The converse is not always true - the delta between codes for nearby points is not always small. But the average delta is small enough that the Morton order is an effective way of linearizing space to support range queries.
MortonCurveBuilder
Generates a LineString representing the Morton Curve at a given level.