Skip to content
Permalink
Browse files

make Dissolve tool work with SpatiaLite (addresses #4571)

  • Loading branch information
alexbruy committed May 23, 2012
1 parent c367a35 commit 53cd1d44a0e67d8f2f5bfbd95572bfe4261a7210
Showing with 7 additions and 4 deletions.
  1. +7 −4 python/plugins/fTools/tools/doGeoprocessing.py
@@ -599,14 +599,16 @@ def dissolve( self, useField ):
vproviderA = self.vlayerA.dataProvider()
allAttrsA = vproviderA.attributeIndexes()
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )
writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()
inFeat = QgsFeature()
outFeat = QgsFeature()
vproviderA.rewind()
vproviderA.select( allAttrsA )
nElement = 0
attrs = None
# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -642,8 +644,8 @@ def dissolve( self, useField ):
for item in unique:
first = True
add = False
vproviderA.select( allAttrsA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
for inFeat in selectionA:
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -703,13 +705,14 @@ def dissolve( self, useField ):
for item in unique:
first = True
add = True
vproviderA.select( allAttrsA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
while vproviderA.nextFeature( inFeat ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
atMap = inFeat.attributeMap()
tempItem = atMap[ self.myParam ]

if tempItem.toString().trimmed() == item.toString().trimmed():
if first:
QgsGeometry( inFeat.geometry() )

0 comments on commit 53cd1d4

Please sign in to comment.
You can’t perform that action at this time.