Skip to content

Commit

Permalink
ftools: field uniqueness fix (fixes #11523)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 30, 2014
1 parent d941949 commit f097080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -919,6 +919,7 @@ def intersect( self ):
crs_match = None
else:
crs_match = crsA == crsB

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
Expand All @@ -928,6 +929,7 @@ def intersect( self ):
inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()

nElement = 0

index = ftools_utils.createIndex( vproviderB )
Expand Down Expand Up @@ -1104,6 +1106,7 @@ def union( self ):
inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()

indexA = ftools_utils.createIndex( vproviderB )
indexB = ftools_utils.createIndex( vproviderA )

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/ftools_utils.py
Expand Up @@ -175,7 +175,7 @@ def createUniqueFieldName( field ):
val = 2
else:
val = val + 1
field.setName( shortName[len( shortName )-1:] + unicode( val ) )
field.setName( shortName[:-1] + str( val ) )
except ValueError:
field.setName( shortName + "_2" )
else:
Expand Down

0 comments on commit f097080

Please sign in to comment.