mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-09 00:17:27 -05:00
fix Merge shapefiles tool in fTools (fix #7570)
This commit is contained in:
parent
6ebedbc59d
commit
f8834f201a
@ -283,8 +283,12 @@ class ShapeMergeThread( QThread ):
|
||||
self.geom = newLayer.wkbType()
|
||||
vprovider = newLayer.dataProvider()
|
||||
|
||||
fields = QgsFields()
|
||||
for f in mergedFields:
|
||||
fields.append(f)
|
||||
|
||||
writer = QgsVectorFileWriter( self.outputFileName, self.outputEncoding,
|
||||
mergedFields, self.geom, self.crs )
|
||||
fields, self.geom, self.crs )
|
||||
|
||||
shapeIndex = 0
|
||||
for fileName in self.shapes:
|
||||
@ -308,8 +312,8 @@ class ShapeMergeThread( QThread ):
|
||||
# fill available attributes with values
|
||||
fieldIndex = 0
|
||||
for v in inFeat.attributes():
|
||||
if fieldMap.has_key(shapeIndex) and fieldMap[shapeIndex].has_key(layerIndex):
|
||||
mergedAttrs[ fieldMap[shapeIndex][layerIndex] ] = v
|
||||
if fieldMap.has_key(shapeIndex) and fieldMap[shapeIndex].has_key(fieldIndex):
|
||||
mergedAttrs[ fieldMap[shapeIndex][fieldIndex] ] = v
|
||||
fieldIndex += 1
|
||||
|
||||
inGeom = QgsGeometry( inFeat.geometry() )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user