Skip to content

Commit 7f19941

Browse files
author
cfarmer
committed
dummy commit to reflect changes to address #3148: writing output with conflicting field names now handled gracefully by writer (or caught ahead of time by fTools)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15385 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent bd042ba commit 7f19941

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

python/plugins/fTools/tools/doGeoprocessing.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def buffering( self, useField ):
321321
fields = vproviderA.fields()
322322
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
323323
fields, QGis.WKBPolygon, vproviderA.crs() )
324+
# check if writer was created properly, if not, return with error
324325
if writer.hasError():
325326
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()
326327
outFeat = QgsFeature()
@@ -449,7 +450,7 @@ def buffering( self, useField ):
449450
nElement += 1
450451
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
451452
del writer
452-
return GEOS_EXCEPT, FEATURE_EXCEPT, True
453+
return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
453454

454455
def convex_hull(self, useField ):
455456
GEOS_EXCEPT = True
@@ -583,7 +584,7 @@ def convex_hull(self, useField ):
583584
except:
584585
GEOS_EXCEPT = False
585586
del writer
586-
return GEOS_EXCEPT, FEATURE_EXCEPT, True
587+
return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
587588

588589
def dissolve( self, useField ):
589590
GEOS_EXCEPT = True
@@ -594,7 +595,7 @@ def dissolve( self, useField ):
594595
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
595596
fields, vproviderA.geometryType(), vproviderA.crs() )
596597
if writer.hasError():
597-
return GEOS_EXCEPT, FEATURE_EXCEPT, True, False
598+
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()
598599
inFeat = QgsFeature()
599600
outFeat = QgsFeature()
600601
vproviderA.rewind()
@@ -722,7 +723,7 @@ def dissolve( self, useField ):
722723
outFeat.setAttributeMap( attrs )
723724
writer.addFeature( outFeat )
724725
del writer
725-
return GEOS_EXCEPT, FEATURE_EXCEPT, True
726+
return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
726727

727728
def difference( self ):
728729
GEOS_EXCEPT = True
@@ -881,7 +882,7 @@ def difference( self ):
881882
FEATURE_EXCEPT = False
882883
continue
883884
del writer
884-
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match
885+
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, None
885886

886887
def intersect( self ):
887888
GEOS_EXCEPT = True
@@ -1531,7 +1532,7 @@ def clip( self ):
15311532
GEOS_EXCEPT = False
15321533
continue
15331534
del writer
1534-
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match
1535+
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, None
15351536

15361537
def checkParameter( self, layer, param ):
15371538
if self.myFunction == 1:

0 commit comments

Comments
 (0)