[Qgis-developer] Spatialite views not working in QGIS

a.furieri at lqt.it a.furieri at lqt.it
Fri Apr 29 04:39:22 EDT 2011


On Fri, 29 Apr 2011 09:33:42 +0200, Stefan Keller wrote

> SQLite claims to be a mostly SQL compliant database and offers views.
> So if views are there and work ... why should'nt this work in QGIS?
> 

Hi Stefan,

quick answer, but exhaustive (so I hope):

a) yes, that's true: SQLite fully supports VIEWs
  with no odd limitations

b) anyway, SQLite support for Spatial Index (R*Tree)
  is completely different from anything else: on
  SQLite the Spatial Index is a separate table, and
  you are required to explicitly perform a sub-query
  in order to take profit from a Spatial Index when
  it's available (please note: the QGIS own data provider
  silently handles all this in a completely painless way)

c) accordingly to all this, SpatiaLite defines any
  Spatial VIEW on VIEWS_GEOMETRY_COLUMNS (not on
  GEOMETRY_COLUMNS): and this allows to fully support 
  Spatial Index for VIEWs as well 

bye Sandro


More information about the Qgis-developer mailing list