[Qgis-developer] Bugs in SpatiaLite provider?

Alexander Bruy alexander.bruy at gmail.com
Sat Jul 4 04:14:07 EDT 2009


Hi, list!

I'm try to move one project from shapefiles to SpatiaLite database and
find some bugs I think.
I've create new empty spatial database with nessesary spatial and
ordinary tables, QGIS load
empty spatial table succesfully.
Also I create simple plugin which copies features from shapefile layer
to SpatiaLite layer, but it
doesn't work. So I tested this plugin with both shapefiles layers
(source and destination) and it
works fine and copies features from source to destination.
Here some code:

vproviderA = vlayerA.dataProvider() # source shapefile layer
allAttrsA = vproviderA.attributeIndexes()
vproviderA.select( allAttrsA )
		
vproviderB = vlayerB.dataProvider() # destination SpatiaLite layer

inFeat = QgsFeature()
Geom = QgsGeometry()
lstFeatures = []

vproviderA.rewind()
while vproviderA.nextFeature( inFeat ):
	Geom = QgsGeometry( inFeat.geometry() )
	outFeat = QgsFeature()
	outFeat.setGeometry( Geom )
	lstFeatures.append( outFeat )
vproviderB.addFeatures( lstFeatures )

Is this code correct or possible I do something wrong? Or maybe this
is a bug in SpatiaLite data provider (in addFeatures method)?

Another problem string attributes are clipped when they contains
national characters (e.g. "і", "ї", "є"). How to check:
  1. Create empty SpatiaLite base with one spatial table
  2. Add this layer to QGIS
  3. Create one feature and add text attribute with national
characters (I use ukrainian)
  4. Save
String is clipped on first national character.

And at end I have one question related to QGIS and SpatiaLite. Is it
possible to create and add spatial view as layer to QGIS.
With PostGIS layers it's possible, so I think it's possible add this
functionality for SpatiaLite

-- 
Alexander Bruy

mailto: alexander.bruy at gmail.com


More information about the Qgis-developer mailing list