Bug report #19539

GRASS i.gensig and i.maxlik

Added by Patrice Carbonneau over 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/GRASS
Affected QGIS version:3.2.1 Regression?:No
Operating System:Win10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27366

Description

I am having major issues with GRASS and SAGA processing tools. This report is about GRASS tools for classification. When running through the procedure, i.gensig runs but closes. I can't see the log file. It does produce a signature and I have attached it. In the error log, there seems to be a problem with this signature, it's the first mention of errors. Then it seems that the tool cannot find the raster image group it created. Full error log is below:

Algorithm 'i.maxlik' starting…
Input parameters: { 'GRASS_RASTER_FORMAT_META' : '', 'GRASS_RASTER_FORMAT_OPT' : '', 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'input' : ['C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/ff682a87d4e341358eec94aa0e0179d9/B.sdat','C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/597d0f6b759947919cd4d5cd53bfc2b5/G.sdat','C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/33c61bf0bbb1409d9b79545684848d28/R.sdat'], 'output' : 'C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/4b51fe8a7282498dbeec1b4398b973f9/output.tif', 'reject' : 'C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/d9f1b86081ba42f194b0153ad8499cea/reject.tif', 'signaturefile' : 'D:/DeepRiverscapes/Qtest_signatures_split.txt' }

g.proj -c proj4="+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"
r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\ff682a87d4e341358eec94aa0e0179d9\B.sdat" band=1 output="rast_5b640d296aee516" --overwrite -o
r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\597d0f6b759947919cd4d5cd53bfc2b5\G.sdat" band=1 output="rast_5b640d296aee517" --overwrite -o
r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\33c61bf0bbb1409d9b79545684848d28\R.sdat" band=1 output="rast_5b640d296aee518" --overwrite -o
g.region n=800.0 s=0.0 e=1228.0 w=0.0 res=1.0
i.group group=group_5b640d296b69419 subgroup=subgroup_5b640d296b69420 input=rast_5b640d296aee516,rast_5b640d296aee517,rast_5b640d296aee518
MD C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig
COPY /Y D:/DeepRiverscapes/Qtest_signatures_split.txt C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig\Qtest_signatures_split.txt
i.maxlik signaturefile="Qtest_signatures_split.txt" group="group_5b640d296b69419" subgroup="subgroup_5b640d296b69420" output=output6b078ef4b4c4478fb568df68904c2d81 reject=reject6b078ef4b4c4478fb568df68904c2d81 --overwrite
g.region raster=output6b078ef4b4c4478fb568df68904c2d81
r.out.gdal -t -m input="output6b078ef4b4c4478fb568df68904c2d81" output="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\4b51fe8a7282498dbeec1b4398b973f9\output.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
g.region raster=reject6b078ef4b4c4478fb568df68904c2d81
r.out.gdal -t -m input="reject6b078ef4b4c4478fb568df68904c2d81" output="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\d9f1b86081ba42f194b0153ad8499cea\reject.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
Cleaning up temporary files...
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Executing <C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\grass_batch_job.cmd> ...

C:\PROGRA~1\QGIS3~1.2\bin>chcp 1252 1>NUL

C:\PROGRA~1\QGIS3~1.2\bin>g.proj -c proj4="+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Projection information updated

C:\PROGRA~1\QGIS3~1.2\bin>r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\ff682a87d4e341358eec94aa0e0179d9\B.sdat" band=1 output="rast_5b640d296aee516" --overwrite -o
Over-riding projection check
Reading band 1 of 1...
r.external complete. Link to raster map <rast_5b640d296aee516> created.

C:\PROGRA~1\QGIS3~1.2\bin>r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\597d0f6b759947919cd4d5cd53bfc2b5\G.sdat" band=1 output="rast_5b640d296aee517" --overwrite -o
Over-riding projection check
Reading band 1 of 1...
r.external complete. Link to raster map <rast_5b640d296aee517> created.

C:\PROGRA~1\QGIS3~1.2\bin>r.external input="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\33c61bf0bbb1409d9b79545684848d28\R.sdat" band=1 output="rast_5b640d296aee518" --overwrite -o
Over-riding projection check
Reading band 1 of 1...
r.external complete. Link to raster map <rast_5b640d296aee518> created.

C:\PROGRA~1\QGIS3~1.2\bin>g.region n=800.0 s=0.0 e=1228.0 w=0.0 res=1.0

C:\PROGRA~1\QGIS3~1.2\bin>i.group group=group_5b640d296b69419 subgroup=subgroup_5b640d296b69420 input=rast_5b640d296aee516,rast_5b640d296aee517,rast_5b640d296aee518
Adding raster map <rast_5b640d296aee516@PERMANENT> to group
Adding raster map <rast_5b640d296aee517@PERMANENT> to group
Adding raster map <rast_5b640d296aee518@PERMANENT> to group
Adding raster map <rast_5b640d296aee516@PERMANENT> to subgroup
Adding raster map <rast_5b640d296aee517@PERMANENT> to subgroup
Adding raster map <rast_5b640d296aee518@PERMANENT> to subgroup

C:\PROGRA~1\QGIS3~1.2\bin>MD C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig

C:\PROGRA~1\QGIS3~1.2\bin>COPY /Y D:/DeepRiverscapes/Qtest_signatures_split.txt C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig\Qtest_signatures_split.txt
The syntax of the command is incorrect.

C:\PROGRA~1\QGIS3~1.2\bin>i.maxlik signaturefile="Qtest_signatures_split.txt" group="group_5b640d296b69419" subgroup="subgroup_5b640d296b69420" output=output6b078ef4b4c4478fb568df68904c2d81 reject=reject6b078ef4b4c4478fb568df68904c2d81 --overwrite
ERROR: Unable to open signature file <Qtest_signatures_split.txt>

C:\PROGRA~1\QGIS3~1.2\bin>g.region raster=output6b078ef4b4c4478fb568df68904c2d81
ERROR: Raster map <output6b078ef4b4c4478fb568df68904c2d81> not found

C:\PROGRA~1\QGIS3~1.2\bin>r.out.gdal -t -m input="output6b078ef4b4c4478fb568df68904c2d81" output="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\4b51fe8a7282498dbeec1b4398b973f9\output.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
ERROR: Raster map or group <output6b078ef4b4c4478fb568df68904c2d81> not found

C:\PROGRA~1\QGIS3~1.2\bin>g.region raster=reject6b078ef4b4c4478fb568df68904c2d81
ERROR: Raster map <reject6b078ef4b4c4478fb568df68904c2d81> not found

C:\PROGRA~1\QGIS3~1.2\bin>r.out.gdal -t -m input="reject6b078ef4b4c4478fb568df68904c2d81" output="C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\d9f1b86081ba42f194b0153ad8499cea\reject.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
ERROR: Raster map or group <reject6b078ef4b4c4478fb568df68904c2d81> not found

C:\PROGRA~1\QGIS3~1.2\bin>exit
Execution of <C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\grass_batch_job.cmd> finished.
Cleaning up temporary files...
Press any key to continue . . .
Execution completed in 2.35 seconds
Results: {'output': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/4b51fe8a7282498dbeec1b4398b973f9/output.tif, 'createOptions': {'fileEncoding': 'System'}}>,
'reject': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/d9f1b86081ba42f194b0153ad8499cea/reject.tif, 'createOptions': {'fileEncoding': 'System'}}>}

Loading resulting layers
The following layers were not correctly generated.<ul><li>C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/4b51fe8a7282498dbeec1b4398b973f9/output.tif</li><li>C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/d9f1b86081ba42f194b0153ad8499cea/reject.tif</li></ul>You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Qtest_signatures_split.txt Magnifier - Signatures file from i.gensig (170 Bytes) Patrice Carbonneau, 2018-08-03 10:16 AM

Qtest_modified.aux.xml Magnifier (862 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest2_class.dbf (99 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest2_class.shp (508 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest2_class.shx (124 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest2_class.prj (388 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest2_class.qpj (597 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest_Classes.dbf (121 Bytes) Patrice Carbonneau, 2018-08-04 09:36 AM

Qtest_modified (3.44 MB) Patrice Carbonneau, 2018-08-04 09:36 AM

Associated revisions

Revision 282f95c9
Added by Nyall Dawson over 5 years ago

[processing][grass] Fix bad move/copy paths in grass i.gensig/maxlik algs

Refs #19539

Revision 6502dba2
Added by Nyall Dawson over 5 years ago

[processing][grass] Fix bad move/copy paths in grass i.gensig/maxlik algs

Refs #19539

(cherry-picked from 282f95c9f7)

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Does it work on QGIS LTR?

#2 Updated by Nyall Dawson over 5 years ago

The problem comes in the command:

COPY /Y D:/DeepRiverscapes/Qtest_signatures_split.txt C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig\Qtest_signatures_split.txt

I suspect it's the unix style path with / which is tripping this up. Investigating now...

#3 Updated by sarah david over 5 years ago

-

#4 Updated by Patrice Carbonneau over 5 years ago

Giovanni Manghi wrote:

Does it work on QGIS LTR?

I don't know. Haven't got it installed. I use some new features in 3.2 quite a bit so would rather get 3.2 working.

#5 Updated by Giovanni Manghi over 5 years ago

Patrice Carbonneau wrote:

Giovanni Manghi wrote:

Does it work on QGIS LTR?

I don't know. Haven't got it installed. I use some new features in 3.2 quite a bit so would rather get 3.2 working.

but 3.* is NOT LTR yet, for important work people should still rely on the table version if QGIS.

#6 Updated by Nyall Dawson over 5 years ago

Can you please share some small test data which I can use to create a unit test protecting this? (With a trial bug fix every raster I throw at it results in grass errors relating to the classification itself, not a processing error!).

#7 Updated by Patrice Carbonneau over 5 years ago

Ok, here is a test data set. I uploaded a vector in ESRI format and an image. These are the files I used to run i.gensig and (with the rsulting signature file, run i.maxlik.

Thanks

#8 Updated by Jürgen Fischer over 5 years ago

  • Status changed from Feedback to Open

#9 Updated by Alexander Bruy almost 5 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Already fixed.

Also available in: Atom PDF