Hi Wolfgang,
On 19/6/2014 11:54 PM, Wolfgang Enzinger wrote:
Not sure why you think you have to store those point coordinates twice.
This works:
sqlite> CREATE VIRTUAL TABLE abc USING rtree(id,x,y);
sqlite> INSERT INTO abc VALUES(1,20,30);
sqlite> SELECT id FROM abc WHERE x>=10 AND x<=30 AND y >=20 AND y<=40;
1
sqlite> SELECT id FROM abc WHERE x>=40 AND x<=50 AND y >=40 AND y<=50;
sqlite>
I do feel a bit stupid after reading your email... but I guess I was
working on the basis that the data we have is 2 dimensional and my
recollection was that we need 2 items per dimension.
Am I reading this wrong?
The SQLite R*Tree module is implemented as a virtual table. Each R*Tree
index is a virtual table with an odd number of columns between 3 and 11.
The first column is always a 64-bit signed integer primary key. The
other columns are pairs, one pair per dimension, containing the minimum
and maximum values for that dimension, respectively. A 1-dimensional
R*Tree thus has 3 columns. A 2-dimensional R*Tree has 5 columns. A
3-dimensional R*Tree has 7 columns. A 4-dimensional R*Tree has 9
columns. And a 5-dimensional R*Tree has 11 columns. The SQLite R*Tree
implementation does not support R*Trees wider than 5 dimensions.
Best Regards,
Mohit.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users