[Qgis-developer] Load SQLite table into QGIS

maaza mekuria sailmcm at yahoo.com
Fri Oct 14 09:16:35 EDT 2011


I was able to create the spatialite geometry/geometryless tables outside QGIS and now what I would want is to be able to insert data in C++ into tables with and without geometry.

Any ideas?

Maaza

--- On Thu, 10/13/11, Martin Dobias <wonder.sk at gmail.com> wrote:

> From: Martin Dobias <wonder.sk at gmail.com>
> Subject: Re: [Qgis-developer] Load SQLite table into QGIS
> To: "romain riviere" <romain.riviere.974 at gmail.com>
> Cc: qgis-developer at lists.osgeo.org
> Date: Thursday, October 13, 2011, 4:06 PM
> On Mon, Oct 10, 2011 at 8:17 AM,
> romain riviere
> <romain.riviere.974 at gmail.com>
> wrote:
> > Hi,
> > I know how to Load a spatiaLite spatial table into
> QGIS,
> > but I can't find how to load a non spatial table (ie
> simple SQLite table).
> > I've read the pyqgis cookbook, and QGs API, but didn't
> find any answer.
> 
> This should work:
> 
> vlayer = QgsVectorLayer('dbname="/data/gis/test.sqlite"
> table="mytable"', 'mytable', 'spatialite')
> 
> Martin
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 


More information about the Qgis-developer mailing list