[QGIS Commit] r15385 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Mar 7 19:09:39 EST 2011


Author: cfarmer
Date: 2011-03-07 16:09:39 -0800 (Mon, 07 Mar 2011)
New Revision: 15385

Modified:
   trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py
Log:
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)

Modified: trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py	2011-03-07 23:29:15 UTC (rev 15384)
+++ trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py	2011-03-08 00:09:39 UTC (rev 15385)
@@ -321,6 +321,7 @@
     fields = vproviderA.fields()
     writer = QgsVectorFileWriter( self.myName, self.myEncoding,
     fields, QGis.WKBPolygon, vproviderA.crs() )
+    # check if writer was created properly, if not, return with error
     if writer.hasError():
       return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()
     outFeat = QgsFeature()
@@ -449,7 +450,7 @@
           nElement += 1
           self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
     del writer
-    return GEOS_EXCEPT, FEATURE_EXCEPT, True
+    return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
 
   def convex_hull(self, useField ):
     GEOS_EXCEPT = True
@@ -583,7 +584,7 @@
         except:
           GEOS_EXCEPT = False
     del writer
-    return GEOS_EXCEPT, FEATURE_EXCEPT, True
+    return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
 
   def dissolve( self, useField ):
     GEOS_EXCEPT = True
@@ -594,7 +595,7 @@
     writer = QgsVectorFileWriter( self.myName, self.myEncoding,
     fields, vproviderA.geometryType(), vproviderA.crs() )
     if writer.hasError():
-      return GEOS_EXCEPT, FEATURE_EXCEPT, True, False
+      return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()
     inFeat = QgsFeature()
     outFeat = QgsFeature()
     vproviderA.rewind()
@@ -722,7 +723,7 @@
             outFeat.setAttributeMap( attrs )
             writer.addFeature( outFeat )
     del writer
-    return GEOS_EXCEPT, FEATURE_EXCEPT, True
+    return GEOS_EXCEPT, FEATURE_EXCEPT, True, None
 
   def difference( self ):
     GEOS_EXCEPT = True
@@ -881,7 +882,7 @@
               FEATURE_EXCEPT = False
               continue
     del writer
-    return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match
+    return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, None
 
   def intersect( self ):
     GEOS_EXCEPT = True
@@ -1531,7 +1532,7 @@
                 GEOS_EXCEPT = False
                 continue
     del writer
-    return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match
+    return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, None
 
   def checkParameter( self, layer, param ):
     if self.myFunction == 1:



More information about the QGIS-commit mailing list