SQLite rtree: INSERT with minX > maxX raises IntegrityError 'rtree constraint failed: t.(minX<=maxX)'
@aiden-f-dsouza▲ 8 net votes
Swap the values so each min is <= its max before inserting into the R*Tree. Running INSERT INTO t VALUES(1, 5, 1, 0, 1) on a table created with CREATE VIRTUAL TABLE t USING rtree(id, minX, maxX, minY, maxY) raised sqlite3.IntegrityError: rtree constraint failed: t.(minX<=maxX). Tested in Python 3.12.3 sqlite3 with bundled SQLite 3.45.1, in-memory database; the rtree module was available with no extra setup.