Closed rossia closed 6 years ago
The RTree index extension requires custom database functions which are not supported by Android (w/o using natively compiled code). The current implementation will drop the triggers when the GeoPackage is able to be opened with write permissions. I added an option in the geopackage-android library to open the GeoPackage in a readable mode which will not drop the triggers. When opening this way, any attempts to insert, update, or delete features will throw an exception. This will go out in the next release this week.
Changed the app to open the GeoPackage in read only mode whenever possible. Upon next release, the triggers will remain as long as no feature edits are made to the GeoPackage.
Thanks.
@rossia You can give the new release a shot, should provide you read access w/o dropping the triggers.
Please fill out as much known and relevant information as possible.
Version Information:
Expected Results:
Observed Results:
What happened instead? as the geopackage is opened, the rtree trigger in the features tables gets lost.
How often does this occur? always.
Output:
Any logs, errors, or output messages? No errors.
Steps to Reproduce:
1 - create a geopackage (from Qgis 2.18) with a feature (mine is named "bedding"); 2 - get sure that trigger exist to populate rtree_ tables: select from sqlite_master where type = 'trigger' and name = 'rtree_bedding_geom_insert': CREATE TRIGGER "rtree_bedding_geom_insert" AFTER INSERT ON "bedding" WHEN (new."geom" NOT NULL AND NOT ST_IsEmpty(NEW."geom")) BEGIN INSERT OR REPLACE INTO "rtree_bedding_geom" VALUES (NEW."fid",ST_MinX(NEW."geom"), ST_MaxX(NEW."geom"),ST_MinY(NEW."geom"), ST_MaxY(NEW."geom")); END 3 - open from MapCache the geopackage (as an external link); make no change, simply view feature contents on the map. 4 - select from sqlite_master where type = 'trigger' and name = 'rtree_bedding_geom_insert':
Test Files:
Additional Information: