Skip to content
Permalink
Browse files
[sextante] more tests
  • Loading branch information
volaya committed Mar 27, 2013
1 parent 91fa062 commit 72037dc9be812d7b42c097a19fa9e1eeaedc44cf
@@ -45,7 +45,7 @@ def processAlgorithm(self, progress):
vlayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
vprovider = vlayer.dataProvider()
fields = vprovider.fields()
fields[len(fields)] = QgsField("AUTO", QVariant.Int)
fields.append(QgsField("AUTO", QVariant.Int))
writer = output.getVectorWriter(fields, vprovider.geometryType(), vlayer.crs() )
inFeat = QgsFeature()
outFeat = QgsFeature()
@@ -58,10 +58,10 @@ def processAlgorithm(self, progress):
nElement += 1
inGeom = inFeat.geometry()
outFeat.setGeometry( inGeom )
atMap = inFeat.attributeMap()
atMap.append(QVariant(nElement))
outFeat.setAttributeMap( atMap )
writer.addFeature( outFeat )
attrs = inFeat.attributes()
attrs.append(QVariant(nElement))
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
del writer

def defineCharacteristics(self):
@@ -56,7 +56,6 @@ def processAlgorithm(self, progress):
vproviderA = vlayerA.dataProvider()
fields = vproviderA.fields()
writer = self.getOutputFromName(Dissolve.OUTPUT).getVectorWriter(fields, vproviderA.geometryType(), vproviderA.crs() )
#inFeat = QgsFeature()
outFeat = QgsFeature()
nElement = 0
nFeat = vproviderA.featureCount()
@@ -204,12 +204,10 @@ def processAlgorithm(self, progress):
ns['progress'] = progress

for param in self.parameters:
#script += param.name + "=" + param.getValueAsCommandLineParameter() + "\n"
ns[param.name] = param.value

for out in self.outputs:
ns[out.name] = out.value
#script += out.name + "=" + out.getValueAsCommandLineParameter() + "\n"

script+=self.script
exec(script) in ns

0 comments on commit 72037dc

Please sign in to comment.