Answer:
vlayer = QgsVectorLayer('track.shp', 'layer_name_you_like', 'ogr')
error_msg = ''
error = QgsVectorFileWriter.writeAsVectorFormat( vlayer, 'test.sqlite',
'System', vlayer.crs(), 'SQLite', False, error_msg, [ SPATIALITE=YES , ] )
where:
vlayer = vector
Leaving source code for future reference:
Exporting Shapefile or Vector Layer to Spatialite using QgsVectorFileWriter
# -*- coding: utf-8 -*-
import sys
from qgis.core import *
app = QgsApplication(sys.argv, False)
# need to locate srs.db
app.setPkgDataPath( '/usr/local/share/qgis' )
# need
Is it possible to create a spatialite layer using python bindings?
I compiled qgis version 1.8 from source on Ubuntu 12.04
GDAL 1.9.2
Spatialite 3.0.0~beta20110817-3
I enable PYSPATIALITE from ccmake menu.
From plugin if i call the method:
QgsVectorFileWriter.supportedFiltersAndFormats()
I