On Tue, Nov 25, 2008 at 01:26:48PM +0100, Oyvind Idland scratched on the wall: > Hi, > > as far as I can see from docs, the r-tree extension uses 32-bit floats to > store rectangles. > > However, when I try to insert this one > > INSERT INTO points_index (id, x, y) VALUES (3, 731.293, 74.463); > > i get "SQL error: constraint failed". > > Reducing the x to 31.293 works. > > Is the r-tree limitied to WGS84 latitude/longitude coordinates ?
From this and your other post, I think you're missing a fundamental point about the R-tree extension: it is designed to hold ranges of data, not points. An R-tree with three values defines a one-dimensional space not as (id, x, y), but as (id, min_x, max_x). If you want to do 2D coords, such as lat/long, you need an R-tree with five columns: (id, x_min, x_max, y_min, y_max). You can put equal values in to define points, or you can define "boxes" of space. Either way, it must be true that (x_min <= x_max) (and so on), hence the bind and constraint errors you're getting. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users