[QGIS-Developer] Importing into gpkg error

Paolo Cavallini cavallini at faunalia.it
Thu Jan 25 12:13:01 PST 2018


Hi all,
dropping a shp with a strange prj (attached, recognized as EPSG:102091)
into a gpkg results in an error [0].
What is worse, the db becomes apparently unusable.
Data available, I can do further tests if useful.
Thanks.

---
[0]
An error has occurred while executing Python code:

RuntimeError: In ExecuteSQL(): sqlite3_prepare_v2(SELECT srid FROM
gpkg_spatial_ref_sys WHERE table_name = 'animals'):   no such column: srid
Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line
438, in rowCount
    self._refreshIndex(parent, True)
  File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line
489, in _refreshIndex
    if item.populate():
  File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line
180, in populate
    tables = database.tables()
  File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py",
line 510, in tables
    tables = self.connector.getTables(schema.name if schema else None,
sys_tables)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py",
line 274, in getTables
    vectors = self.getVectorTables(schema)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py",
line 346, in getVectorTables
    srid = self._fetchOne('SELECT srid FROM gpkg_spatial_ref_sys WHERE
table_name = %s' % self.quoteString(lyr.GetName()))
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py",
line 104, in _fetchOne
    sql_lyr = self.gdal_ds.ExecuteSQL(sql.encode('UTF-8'))
  File "/usr/lib/python2.7/dist-packages/osgeo/gdal.py", line 1966, in
ExecuteSQL
    return _gdal.Dataset_ExecuteSQL(self, *args, **kwargs)
RuntimeError: In ExecuteSQL(): sqlite3_prepare_v2(SELECT srid FROM
gpkg_spatial_ref_sys WHERE table_name = 'animals'):
  no such column: srid
-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: animals.prj
Type: application/x-esri-crs
Size: 373 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180125/725a4517/attachment.bin>


More information about the QGIS-Developer mailing list