1

I'm new to QGIS after using ESRI/ENVI/ERDAS products for years. I am trying calculate a cross-tabulated change image for post-classification change detection. After figuring out how to fix a misalignment issue, I entered my input grids, which are 8-bit integer tifs. However, when I try to execute the function, it fails to generate the change products.
I have a few hypotheses:

  1. wrong layer types (e.g. not somehow flagged as classification output)
  2. install problem (says something about SAGA folder not found)
  3. misspecification of the number of classes. I have 12 classes, but there is also a mysterious 255 class (which used to be no-data). I'm not sure what to enter.
  4. Mac issue/QGIS compatibility issues: OS X 10.10.5 (14F2109) & QGIS 2.18.2
  5. (and always the most likely) I'm doing something dumb.

Below are the log windows:

Algorithm Cross-classification and tabulation starting...
io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/6cc17d2bb4d347c8bf52aa8f1b77716f/LC2000.sgrd" -FILES "/Users/Tom (new)/Dropbox/NicaGIS/ChangeDetection72/c72_uso2000re/w001001.adf"
io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -FILES "/Users/Tom (new)/Dropbox/NicaGIS/ChangeDetection72/c72_uso2000re/w001001.adf"
grid_analysis "Cross-Classification and Tabulation" -INPUT "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -INPUT2 "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -MAXNUMCLASS 12 -RESULTGRID "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/8d5691d31a5442e1ac4c1d3f5aa1bd3b/RESULTGRID.sdat" -RESULTTABLE "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/02dace88c2d84c11b2040c0ca71cebe7/RESULTTABLE.csv"
/bin/sh: -c: line 0: syntax error near unexpected token `new'
/bin/sh: -c: line 0: `/Users/Tom (new)/.qgis2//processing/saga_batch_job.sh'
Converting outputs
Loading resulting layers

The following layers were not correctly generated.
Cross-Classification Grid
Cross-Tabulation Table
You can check the log messages to find more information about the execution of the algorithm

****************

Other log window -- not sure the differences:

2017-03-11T17:02:00 1   Specified SAGA folder does not exist. Will try to find built-in binaries.
2017-03-11T17:02:00 1   Specified SAGA folder does not exist. Will try to find built-in binaries.
2017-03-11T17:02:00 0   SAGA execution commands
            io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/6cc17d2bb4d347c8bf52aa8f1b77716f/LC2000.sgrd" -FILES "/Users/Tom (new)/Dropbox/NicaGIS/ChangeDetection72/c72_uso2000re/w001001.adf"
            io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -FILES "/Users/Tom (new)/Dropbox/NicaGIS/ChangeDetection72/c72_uso2000re/w001001.adf"
            grid_analysis "Cross-Classification and Tabulation"  -INPUT "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -INPUT2 "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/ae1feeedf5db45318f64f76d8909ce91/LC2000.sgrd" -MAXNUMCLASS 12 -RESULTGRID "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/8d5691d31a5442e1ac4c1d3f5aa1bd3b/RESULTGRID.sdat" -RESULTTABLE "/var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/02dace88c2d84c11b2040c0ca71cebe7/RESULTTABLE.csv"
2017-03-11T17:02:00 0   SAGA execution console output
            /bin/sh: -c: line 0: syntax error near unexpected token `new'
            /bin/sh: -c: line 0: `/Users/Tom (new)/.qgis2//processing/saga_batch_job.sh'
2017-03-11T17:02:00 2   Error loading result layer:
            Traceback (most recent call last):
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/Postprocessing.py", line 75, in handleAlgorithmResults
                out.name))
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/tools/dataobjects.py", line 199, in load
                + '\nCheck the processing framework log to look for errors')
            RuntimeError: Could not load layer: /var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/8d5691d31a5442e1ac4c1d3f5aa1bd3b/RESULTGRID.sdat
            Check the processing framework log to look for errors

2017-03-11T17:02:00 2   Error loading result layer:
            Traceback (most recent call last):
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/Postprocessing.py", line 75, in handleAlgorithmResults
                out.name))
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/tools/dataobjects.py", line 199, in load
                + '\nCheck the processing framework log to look for errors')
            RuntimeError: Could not load layer: /var/folders/8y/6924gdvx3jg6k2rz5yrzwz100000gr/T/processing6d4bd5aad86b4a63878cdad8f1dd4364/02dace88c2d84c11b2040c0ca71cebe7/RESULTTABLE.csv
            Check the processing framework log to look for errors

1 Answer 1

2

i'll wager it's the space in the file path (between Tom and new). The following error seems to hint at it

syntax error near unexpected token `new'

In some versions of processing, the file path isn't surrounded with quotes when building up the command line to run saga/grass, so path names containing spaces become a problem.

I think this is (largely) fixed as of 2.18, but may still exist in some places.

As a rule of thumb, avoid using spaces in file/directory names (and in some cases, layer names). If you need spaces in file names for readability, replace them with underscores instead.

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.