Reputation:
I want to find the nearest neighbors of a point q given either spatial information or spatio-temporal information. To do this I want to create a B-tree index with keys based on either Z-order curve or Hilbert-curve. However, I have seen that Hilbert-curves are harder to implement than Z-order. My question is:
Is it worth to use Hilbert-curves over Z-order curves in nearest neighbor queries?
Upvotes: 0
Views: 243
Reputation: 28285
Benefit of using a Hilbert Curve is contiguous points cluster quite nicely without those occasional giant jumps as found in the Z order curves. If you are using golang this library offers api calls to both synthesize the curve as well as return a point on the curve given the x,y https://github.com/google/hilbert
Upvotes: 0