Skip to content

Commit

Permalink
[processing] fix Convex Hull algorithm (fix #12643)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 20, 2015
1 parent 584f192 commit 71fa5d4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/plugins/processing/algs/qgis/ConvexHull.py
Expand Up @@ -64,7 +64,7 @@ def processAlgorithm(self, progress):
useField = self.getParameterValue(self.METHOD) == 1
fieldName = self.getParameterValue(self.FIELD)

f = QgsField('value')
f = QgsField('value', QVariant.String, '', 255)
if useField:
index = layer.fieldNameIndex(fieldName)
fType = layer.pendingFields()[index].type()
Expand All @@ -79,12 +79,11 @@ def processAlgorithm(self, progress):
f.setType(QVariant.String)
f.setLength(255)

fields = [
QgsField('id', QVariant.Int, '', 20),
f,
QgsField('area', QVariant.Double, '', 20, 6),
QgsField('perim', QVariant.Double, '', 20, 6)
]
fields = [QgsField('id', QVariant.Int, '', 20),
f,
QgsField('area', QVariant.Double, '', 20, 6),
QgsField('perim', QVariant.Double, '', 20, 6)
]

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
fields, QGis.WKBPolygon, layer.dataProvider().crs())
Expand Down

0 comments on commit 71fa5d4

Please sign in to comment.