1

I have a classification of vegetation communities across a landscape in a .tif format. I wanted to use the GRASS Zero-Crossing Edge Detection tool in QGIS to help define boundaries between my classes-at the moment the edges of each class are rather speckled and I would like a clear defined boundary. However when I run the tool, I get the following message: "The above files could not be opened, which probably indicates that they were not correctly produced by the executed algorithm". It then goes on to say that "GRASS seems to be correctly installed and configured".

I think the problem is possibly with the input file as in the help page it says the type should be "string". However if I convert my file to an .asc the tool will not let me select it as an input.

Has anyone used this tool before? If so, do you have any idea of what the problem is?

1

What version of QGIS do you use and on what OS (Windows, Mac OS X, Linux) ?

When you use a GRASS GIS algorithm, it is interesting to know a minimum of this software.

1) The GRASS GIS command is i.zc and the help says

input=string
   Name of input raster map

input=string just because the name of a layer is not a number as width=integer for example.The dialog in GRASS is:

enter image description here

with some optional values set by GRASS

enter image description here

and in the GRASS shell using the optional values

i.zc input=test@work ouput=result

2) The same command in QGIS

enter image description here

When you use an algorithm in Processing, it creates/modify some files in the /.qgis2/processing folder. The first one is the processing.log file. It records all the commands with the algorithms used and the errors, if they occur. In my case, with the optional values, the result is (with no error):

ALGORITHM|Tue Jun 02 2015
18:27:39|processing.runalg("grass:i.zc","/Users/Shared/test.asc",9,10,1,"202086.577,205625.414407,88411.048,90534.3504441",0,"/Users/Shared/result.tif")

What is the result in your processing.log file ?

As the Python processing module use the subprocess module to execute the commands of GRASS GIS (or SAGA GIS, or...), it creates temporary files. For GRASS GIS, it is named grass_batch_job.sh or grass_batch_job.bat. It contains the effective command/script executed by GRASS GIS.

g.proj -c proj4="+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs"
r.external input="/Users/Shared/test.asc" band=1 output=tmp1433262459625 --overwrite -o -r
g.region n=90534.3504441 s=88411.048 e=205625.414407 w=202086.577 res=35.3883740678
i.zc input=tmp1433262459625 width="9" threshold="10" orientations="1" output=output8cd3786b7ff941b1990fc702c76d756a --overwrite
g.region rast=output8cd3786b7ff941b1990fc702c76d756a
r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"   input=output8cd3786b7ff941b1990fc702c76d756a output="/Users/Shared/result.tif"
exit

Compare with your file.

Hope that will be useful to resolve your problem.

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.