Skip to content

Commit

Permalink
dummy commit to reflect changes to address #3148: writing output with…
Browse files Browse the repository at this point in the history
… conflicting field names now handled gracefully by writer (or caught ahead of time by fTools)

git-svn-id: http://svn.osgeo.org/qgis/trunk@15385 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Mar 8, 2011
1 parent b488037 commit c08e1a4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -321,6 +321,7 @@ def buffering( self, useField ):
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()
Expand Down Expand Up @@ -449,7 +450,7 @@ def buffering( self, useField ):
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
Expand Down Expand Up @@ -583,7 +584,7 @@ def convex_hull(self, useField ):
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
Expand All @@ -594,7 +595,7 @@ def dissolve( self, useField ):
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()
Expand Down Expand Up @@ -722,7 +723,7 @@ def dissolve( self, useField ):
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
Expand Down Expand Up @@ -881,7 +882,7 @@ def difference( self ):
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
Expand Down Expand Up @@ -1531,7 +1532,7 @@ def clip( self ):
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:
Expand Down

0 comments on commit c08e1a4

Please sign in to comment.