2

I have views stored in a spatialite database accessed via QGIS. The views were created by another person on a different computer. The geometry column is well registered in the table views_geometry_columns but when I add the view to the canvas with DB Manager It's seems to just be an attribute table without geometry. I've tried the classical SELECT UpdateLayerStatistics('view_name') but it doesn't change anything.

Any solution(s) ?

Gingerbread
  • 135
  • 9
  • Is there a unique ID column? I have had a similar problem using PostgreSQL (with QGIS and ArcMap). I needed to add an ID column casted to integer. With PostgreSQL, it looked like that: (ROW_NUMBER() OVER())::integer AS id – TurboGraphxBeige Nov 20 '17 at 16:53

1 Answers1

2

I had a similar issue and wrote out steps on how to load it properly using DB Manager here. Spatialite view appears 'filtered' in attribute table, won't load in canvas Give that a go?

As @Gob Tron mentioned you need the view to have a unique ID column and this has to be specified. And the geometry mysteriously does turn up empty in QGIS 2.18.x but it's still there.

she_weeds
  • 12,488
  • 1
  • 28
  • 58