The Hilbert curve is a space-filling curve that preserves locality better than most mappings from one to many dimensions. Originally conceived in two dimensions, it can be generalized to any number of dimensions. Hilbert curves are useful in optimizing database range queries over multiple attributes, such as geospatial queries, and have many other uses.
Questions tagged [hilbert-curve]
67 questions
0
votes
0 answers
How to call Hilbert curve encode C routines
I was trying to run a Hilbert curve code written in C, which I found here
http://www.tddft.org/svn/octopus/trunk/src/grid/hilbert.c
The code runs, but the results I get form the output are not correct. I made a simple driver routine, that takes 3…

Alexander Cska
- 738
- 1
- 7
- 29
0
votes
0 answers
C Signal Processing - Implementation Doubts
I´m trying to adapt a algorithm from matlab.
My algorithm:
#include
#include
#include
#include
#define MAX_LINES 225000
#define MAX_SAMPLE 2500
#define LMAX 200000
#define LFILT …

user3154087
- 11
- 1
0
votes
0 answers
What's wrong with my Hilbert curve?
I have a Javascript library to plot points on a Hilbert curve, but something's wrong with the point determination.
I've written a test page that plots 256 points on a path. While it should look like this, instead it's coming out like this:
You can…

Stuart P. Bentley
- 10,195
- 10
- 55
- 84
-1
votes
1 answer
If the Hilbert Curve Quadtree Works, Why Convert to S2 Cell ID?
I am working on a geospacial service and using Hilbert Curves to convert latitude and longitude to a Quadtree Key.
For example, At level 30:
45.5337699,-122.6988316 converts to 2/221022201033023103222221213221 (Nob Hill)
This can then be…

SeaFuzz
- 1,177
- 9
- 28
-1
votes
1 answer
Indexing order based on Hilbert curve in Java
After two days of searching and trying I couldn't implement Hilbert Curve in java.
I need to fill (for example) 64-pixels into an square-8x8-image based on Hilbert curve. I did the same based on Zig-Zog curve, but (as I suppose to do some feature…

Jalal Aghazadeh
- 164
- 4
- 18
-2
votes
1 answer
Why does this Hilbert Curve implementation ported from C (from Wikipedia) seem to fail?
I found the following code for drawing Hilbert Curves on Wikipedia:
//convert (x,y) to d
int xy2d (int n, int x, int y) {
int rx, ry, s, d=0;
for (s=n/2; s>0; s/=2) {
rx = (x & s) > 0;
ry = (y & s) > 0;
d += s * s *…

d33tah
- 10,999
- 13
- 68
- 158
-4
votes
2 answers
Calculate XY to D for hilbert curve (Convert C code)
I am trying to convert this bit of code from this wikipedia article from C to Delphi.
//convert (x,y) to d
int xy2d (int n, int x, int y) {
int rx, ry, s, d=0;
for (s=n/2; s>0; s/=2) {
rx = (x & s) > 0;
ry = (y & s) > 0;
…

Ali
- 309
- 1
- 3
- 12