Bug report #2178

Spatialite VIEWs give ERROR in attribute table

Added by barryrowlingson - almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied: Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:12238

Description

I have a spatialite DB with tables, they work fine in Qgis.

If I create a view:

CREATE VIEW vmapdata AS SELECT * from mapdata

and add a row to geometry_columns (identical to the row for table mapdata) then I can load the view as a layer in Qgis, and it plots it. I can use the query tool and get attribute values in the popup dialog but if I get the whole attribute table it is full of "ERROR" values.

History

#1 Updated by Sandro Furieri almost 10 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

This one is not at all a bug: it's an attempt to force

spatialite beyond it's specific architectural limits.

Spatial Views are fully supported in spatialite-2.4.0,

but you are required to follow the guide-lines you can

find here:

http://www.gaia-gis.it/spatialite-2.4.0/Using-Views-Basic.pdf

http://www.gaia-gis.it/spatialite-2.4.0/Using-Views-Advanced.pdf

#2 Updated by barryrowlingson - almost 10 years ago

If I do that to create my view, I don't see the view in qgis.

Qgis seems to ignore the "GIS layer Authorization" options set in Spatial-gui and shows anything with a listing in geometry_columns. It doesn't show the spatial view I just created according to the guidelines, I guess because that has its geometry specified in views_geometry_columns.

This is with 1.3.0-Mimas - has the spatialite provider been updated to fix this?

Also available in: Atom PDF