If you're creating GeoPackages with the F.3 RTREE Spatial Indexes
extension, you do not "wrap" a bounding box. You need to define 5
functions from SQL/MM -- ST_MinX, ST_MaxX, ST_MinY, ST_MaxY and
ST_IsEmpty -- that take a geometry blob as input and return (for the
first four) a floating point number or an integer value of 0 or 1
(ST_IsEmpty). Now it is possible you might want to create some sort of
side cache so you don't have to parse the geometry blob four times, but
that is an implementation issue. The exact text of the triggers is
specified by the standard and is not optional if you are using the
extension. And you certainly could not use standard WKB values in the
geometry columns without completely violating the GeoPackage standard.
Peter
On 4/3/2017 9:26 AM, Stadin, Benjamin wrote:
Hi,
Is there a hook which allows to get notified as soon as it’s save to modify a
db connection after (or as alternative to) sqlite3_update_hook was triggered?
The background to this question is that I’m trying to prepare a proposal for
Geopackage. And one of the questions is if it’s possible to avoid Geopackage
using a wrapper object [1] which is used in combination with user defined
functions to update the rtree index after a change to the geometry table
occurred. This object is currently necessary because it wraps another object
(an envelope / bbox) to be used by the user defined function when the SQL
update trigger is called.
So my idea is to register an update hook and do the update to the rtree index
directly after the step(). So this could execute an arbitrary statement, or
more concrete a statement which would read an envelope column from the geometry
table where the update occurred and update the rtree table accordingly. This
would allow those columns to be plain and widely adopted WKB fields instead of
this Geopackage binary wrapper object.
Regards
Ben
[1] http://www.geopackage.org/spec/#gpb_spec
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users