I'm writing a script to treat some rasters. One of steps is a reclassification. So I use r.reclass from Grass. But unfortunately, it return a weird error message: IOError: [Errno 13] Permission denied: u'tmp15066743306927' like it's impossible for it to access this temporary file/folder.

Here is my script :

##sortieR=output raster

from qgis.utils import iface
import sys, processing, os, glob, numpy
from qgis.core import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *

layer = QgsRasterLayer(rasterndvi)

extent = "%f,%f,%f,%f" %(layer.extent().xMinimum(), layer.extent().xMaximum(), layer.extent().yMinimum(), layer.extent().yMaximum())

print extent

outputs_GRASS7RNEIGHBORS_1=processing.runalg('grass7:r.neighbors', rasterndvi,0,25.0,True,False,'',extent,0.0,None)

layer = QgsRasterLayer(outputs_GRASS7RNEIGHBORS_1['output'])

extent = "%f,%f,%f,%f" %(layer.extent().xMinimum(), layer.extent().xMaximum(), layer.extent().yMinimum(), layer.extent().yMaximum())

print extent

outputs_GRASS7RRECLASS_1=processing.runalg('grass7:r.reclass', layer,'','0 thru 85 = 1\n85 thru 170 = 2\n170 thru 255 = 3',extent,0.0,sortieR)

Somebody can help me ?

  • Nobody can help me ? :/ – Tim C. Oct 2 '17 at 8:42

It seems that this was a bug in older versions of QGIS. In recent versions it should work (I have QGIS 3.10.2-A Coruña).

Please make sure you open QGIS with the shortcut "QGIS Desktop 3.10.2 with GRASS 7.8.2" (or whatever your edition is), otherwise, probably no GRASS tools will work. (Solved in this post: GRASS not working with QGIS 3.6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.