[Qgis-developer] Bugs in SpatiaLite provider?
Maxim Dubinin
sim at gis-lab.info
Mon Jul 6 13:16:06 EDT 2009
I confirm. I can't add a feature neither by using addFeatures, nor by
editing a SpatialLite layer interactively in QGIS. In the first case nothing happens, second
produces this error: http://gis-lab.info/images/screenshots/20090704-312-8kb.jpg
Maxim
AB> I'm try to move one project from shapefiles to SpatiaLite database and
AB> find some bugs I think.
AB> I've create new empty spatial database with nessesary spatial and
AB> ordinary tables, QGIS load
AB> empty spatial table succesfully.
AB> Also I create simple plugin which copies features from shapefile layer
AB> to SpatiaLite layer, but it
AB> doesn't work. So I tested this plugin with both shapefiles layers
AB> (source and destination) and it
AB> works fine and copies features from source to destination.
AB> Here some code:
AB> vproviderA = vlayerA.dataProvider() # source shapefile layer
AB> allAttrsA = vproviderA.attributeIndexes()
AB> vproviderA.select( allAttrsA )
AB>
AB> vproviderB = vlayerB.dataProvider() # destination SpatiaLite layer
AB> inFeat = QgsFeature()
AB> Geom = QgsGeometry()
AB> lstFeatures = []
AB> vproviderA.rewind()
AB> while vproviderA.nextFeature( inFeat ):
AB> Geom = QgsGeometry( inFeat.geometry() )
AB> outFeat = QgsFeature()
AB> outFeat.setGeometry( Geom )
AB> lstFeatures.append( outFeat )
AB> vproviderB.addFeatures( lstFeatures )
AB> Is this code correct or possible I do something wrong? Or maybe this
AB> is a bug in SpatiaLite data provider (in addFeatures method)?
AB> Another problem string attributes are clipped when they contains
AB> national characters (e.g. "і", "ї", "є"). How to check:
AB> 1. Create empty SpatiaLite base with one spatial table
AB> 2. Add this layer to QGIS
AB> 3. Create one feature and add text attribute with national
AB> characters (I use ukrainian)
AB> 4. Save
AB> String is clipped on first national character.
AB> And at end I have one question related to QGIS and SpatiaLite. Is it
AB> possible to create and add spatial view as layer to QGIS.
AB> With PostGIS layers it's possible, so I think it's possible add this
AB> functionality for SpatiaLite
More information about the Qgis-developer
mailing list