How to use SAGA ShapesToGrid via Processing in a Python plugin?

المشرف العام

Administrator
طاقم الإدارة
I run these lines in my code:

vectorlayer_vector = ftools_utils.getVectorLayerByName(inputLayer)Elevation = self.lineAttrib.currentText()cellSize = int(self.linePix.value())outPath = self.inputLayerCombo3.text()output = ftools_utils.getRasterLayerByName(outPath) Processing.runAlgorithm("saga:shapestogrid", vectorlayer_vector, Elevation, 0, 0, 4, None, cellSize, output)When I run, I get an tiff image but with nothing. The .aux file is not created and when I try to open the tiff image that I created appears this message:

c:...teste3.tif is not a supported raster data source

So, I guess that the output is wrong. What I have to do to get a correct output? What I missing?

I update my code but I have no results yet.

Please see if you can help me.

My code are:

inputLayer = self.inputLayerCombo.currentText()Elevation = str(self.lineAttrib.currentText())cellSize = int(self.linePix.value())outPath = self.inputLayerCombo3.text()Processing.initialize()Processing.runAlgorithm("saga:shapestogrid", inputLayer, Elevation, 0, 0, 4, "10000.0,14000.0,50000.0,54000.0" , cellSize,outPath)Is a simple code but I don't have any results. I don't know what else to do.It doesn't create a raster.



أكثر...
 
أعلى