Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRASS i.gensig and i.maxlik #27366

Closed
qgib opened this issue Aug 3, 2018 · 9 comments
Closed

GRASS i.gensig and i.maxlik #27366

qgib opened this issue Aug 3, 2018 · 9 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS

Comments

@qgib
Copy link
Contributor

qgib commented Aug 3, 2018

Author Name: Patrice Carbonneau (Patrice Carbonneau)
Original Redmine Issue: 19539
Affected QGIS version: 3.2.1
Redmine category:processing/grass


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:\PROGRA1\QGIS31.2\bin>chcp 1252 1>NUL

C:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.2\bin>g.region n=800.0 s=0.0 e=1228.0 w=0.0 res=1.0

C:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.2\bin>MD C:\Users\patca\AppData\Local\Temp\processing_7c97d6ddd9dd4aeb9964c897acb1336d\grassdata\temp_location\PERMANENT\group\group_5b640d296b69419\subgroup\subgroup_5b640d296b69420\sig

C:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.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:\PROGRA1\QGIS31.2\bin>g.region raster=output6b078ef4b4c4478fb568df68904c2d81
ERROR: Raster map not found

C:\PROGRA1\QGIS31.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 not found

C:\PROGRA1\QGIS31.2\bin>g.region raster=reject6b078ef4b4c4478fb568df68904c2d81
ERROR: Raster map not found

C:\PROGRA1\QGIS31.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 not found

C:\PROGRA1\QGIS31.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.

  • C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/4b51fe8a7282498dbeec1b4398b973f9/output.tif
  • C:/Users/patca/AppData/Local/Temp/processing_7c97d6ddd9dd4aeb9964c897acb1336d/d9f1b86081ba42f194b0153ad8499cea/reject.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.


@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: Giovanni Manghi (@gioman)


Does it work on QGIS LTR?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: Nyall Dawson (@nyalldawson)


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...

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: sarah david (sarah david)


@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: Patrice Carbonneau (Patrice Carbonneau)


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.

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2018

Author Name: Nyall Dawson (@nyalldawson)


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!).

@qgib
Copy link
Contributor Author

qgib commented Aug 4, 2018

Author Name: Patrice Carbonneau (Patrice Carbonneau)


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


  • 13059 was configured as Qtest2_class.dbf
  • 13058 was configured as Qtest_modified.aux.xml
  • 13060 was configured as Qtest2_class.shp
  • 13065 was configured as Qtest_modified
  • 13064 was configured as Qtest_Classes.dbf
  • 13063 was configured as Qtest2_class.qpj
  • 13062 was configured as Qtest2_class.prj
  • 13061 was configured as Qtest2_class.shx

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2018

Author Name: Jürgen Fischer (@jef-n)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented May 23, 2019

Author Name: Alexander Bruy (@alexbruy)


Already fixed.


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed May 23, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS
Projects
None yet
Development

No branches or pull requests

1 participant