On Sunday, February 13, 2011 at 4:15 PM, Jay A. Kreibich wrote: > I have a simple table like so > > > > CREATE TABLE points ( > > id INTEGER PRIMARY KEY, > > lon REAL, > > lat REAL, > > tile INTEGER > > ); > > > > It has about 13.25 million rows. I want to be able to return rows > > given a bounding box (min_lon, min_lat, max_lon, max_lat). Is the > > following the right strategy? > > > > CREATE VIRTUAL TABLE points_rtree USING rtree ( > > id, min_lon, min_lat, max_lon, max_lat > > ); > > Almost. You need to match min/max pairs, so the column order would > need to be: > > ( id, min_lon, max_lon, min_lat, max_lat ) > > ...or... > > ( id, min_lat, max_lat, min_lon, max_lon ) > Fascinating. You mean, the order of the columns in the table definition is > important? I did not realize that would be important.
Puneet. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users