I think the RTree update table in update6 should be rtree_<t>_<c> instead of <t>.
Otherwise it causes errors such as
SQL error or missing database (no such column: minx)
attempting to update non existing min/max x/y columns on the feature table instead of the RTree.
Change this...
CREATE TRIGGER rtree_<t>_<c>_update6 AFTER UPDATE OF <c> ON <t>
WHEN OLD.<i> = NEW.<i> AND
(NEW.<c> NOTNULL AND NOT ST_IsEmpty(NEW.<c>)) AND
(OLD.<c> NOTNULL AND NOT ST_IsEmpty(OLD.<c>))
BEGIN
UPDATE <t> SET
minx = ST_MinX(NEW.<c>),
maxx = ST_MaxX(NEW.<c>),
miny = ST_MinY(NEW.<c>),
maxy = ST_MaxY(NEW.<c>)
WHERE id = NEW.<i>;
END;
to this...
CREATE TRIGGER rtree_<t>_<c>_update6 AFTER UPDATE OF <c> ON <t>
WHEN OLD.<i> = NEW.<i> AND
(NEW.<c> NOTNULL AND NOT ST_IsEmpty(NEW.<c>)) AND
(OLD.<c> NOTNULL AND NOT ST_IsEmpty(OLD.<c>))
BEGIN
UPDATE rtree_<t>_<c> SET
minx = ST_MinX(NEW.<c>),
maxx = ST_MaxX(NEW.<c>),
miny = ST_MinY(NEW.<c>),
maxy = ST_MaxY(NEW.<c>)
WHERE id = NEW.<i>;
END;
I think the RTree update table in update6 should be
rtree_<t>_<c>
instead of<t>
. Otherwise it causes errors such asSQL error or missing database (no such column: minx)
attempting to update non existing min/max x/y columns on the feature table instead of the RTree.Change this...
to this...