Spatialite and GPKG mode are enabled:
SELECT load_extension('mod_spatialite');
SELECT EnableGpkgMode();
Spatialite knows about gpkg_spatial_ref_sys
(gpkgInsertEpsgSRID()
uses it), and the table
is populated:
sqlite> SELECT srs_name, srs_id FROM gpkg_spatial_ref_sys;
Undefined cartesian SRS|-1
Undefined geographic SRS|0
WGS 84 geodetic|4326
Amersfoort / RD New|28992
Yet when I try to use ST_Transform()
it tries to look for (and fails to find) spatial_ref_sys
:
sqlite> SELECT ST_Transform(gpkgMakePoint(5.140743, 51.630698, 4326), 28992);
unknown SRID: 4326 <no such table: spatial_ref_sys>
unknown SRID: 28992 <no such table: spatial_ref_sys>
Error: ST_Transform exception - unable to find the origin SRID.
What am I doing wrong? Does GPKG mode not support ST_Transform()
? What is gpkgInsertEpsgSRID()
for then?
Version info:
sqlite> SELECT spatialite_version(), sqlite_version();
5.0.1|3.34.1
InitSpatialMetaData
.gpkgInsertEpsgSRID()
needs to be there because GPKG is not valid without GPKG metadata tables.