Bug report #20281

QGIS 3.4: Python error when running "r.texture" on Windows

Added by Odysseas Vl about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:GRASS
Affected QGIS version:3.4.0 Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:28102

Description

In continuation of Bug report #20146,
QGIS 3.4 Madeira and GRASS 7. r.texture does not provide any output. Not in temp, not in user defined folder.
I have tried the function in Windows 10 64bit. On the same systems, QGIS 2.18 provided the outputs fine.

LOG outputs are like this:

Suspicious message "r was unexpected at this time."

Algorithm 'r.texture' starting…
Input parameters:
{ '-a' : False, '-s' : False, 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'distance' : 1, 'input' : 'C:/Users/…/asdf.tif', 'method' : [0], 'output' : 'C:\\Users\\...\\TESTFOLDER\\qw', 'size' : 3 }

r.external input="C:\Users\...\asdf.tif" band=1 output="rast_5bd897a9cae473" --overwrite -o
g.region n=… s=… e=… w=… res=0.0891700128040893
r.texture input=rast_5bd897a9cae473 method="asm" size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec --overwrite
for r in $(g.list type=rast pattern='outputbf78f3ac0afc498ca24722f3e2ee97ec*'); do
r.out.gdal -m -t input=${r} output=C:\Users\...\TESTFOLDER\qw/${r}.tif --overwrite -c createopt="TFW=YES,COMPRESS=LZW" 
done
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Executing <C:\Users\...\AppData\Local\Temp\processing_99d8c583f2914262bb9d62de6da82492\grassdata\grass_batch_job.cmd> ...

C:\OSGEO4~1\bin>chcp 1252 1>NUL 

C:\OSGEO4~1\bin>r.external input="C:\Users\...\Desktop\QGIS_BARESOIL_2018\TESTFOLDER\asdf.tif" band=1 output="rast_5bd897a9cae473" --overwrite -o 
Over-riding projection check
Reading band 1 of 1...
r.external complete. Link to raster map <rast_5bd897a9cae473> created.

C:\OSGEO4~1\bin>g.region n=… s=… e=… w=… res=0.0891700128040893 

C:\OSGEO4~1\bin>r.texture input=rast_5bd897a9cae473 method="asm" size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec --overwrite 
Reading raster map...
Calculating Angular Second Moment...
2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100
r was unexpected at this time.

C:\OSGEO4~1\bin>for r in $(g.list type=rast pattern='outputbf78f3ac0afc498ca24722f3e2ee97ec*'); do
Execution of <C:\Users\...\AppData\Local\Temp\processing_99d8c583f2914262bb9d62de6da82492\grassdata\grass_batch_job.cmd> finished.
Cleaning up temporary files...
Press any key to continue . . . 
Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Algorithm.py", line 411, in processAlgorithm
Grass7Utils.executeGrass(self.commands, feedback, self.outputCommands)
File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Utils.py", line 399, in executeGrass
startupinfo=si if isWindows() else None
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect
Execution failed after 14.01 seconds

Loading resulting layers
Algorithm 'r.texture' finished

From the history in QGIS 3.4 FAILURE:

processing.run("grass7:r.texture", {'input':'C:/Users/.../asdf.tif','method':[0],'size':3,'distance':1,'-s':False,'-a':False,'output':'C:\\Users\\...\\TESTFOLDER\\qw','GRASS_REGION_PARAMETER':None,'GRASS_REGION_CELLSIZE_PARAMETER':0})

From the history in QGIS 2.18.25 SUCCESS:

processing.runalg("grass7:r.texture","C:/Users/.../asdf.tif","asm",3,1,False,False,"...,...,...,...","C:\\Users\\...\\TESTFOLDER\\qw")


Related issues

Duplicates QGIS Application - Bug report #20146: QGIS 3.2.3 Bonn and GRASS 7. r.texture does not provide a... Closed 2018-10-17

History

#1 Updated by Giovanni Manghi about 6 years ago

  • Subject changed from QGIS 3.4 , GRASS 7, r.texture does not work to QGIS 3.4: Python error when running "r.texture" on Windows
  • Operating System changed from Windows 10 64bit to Windows
  • Regression? changed from No to Yes

Works as expected on Linux. Works as expected on 2.18.

#2 Updated by Giovanni Manghi about 6 years ago

This seems to be a more general issue rather than one specific to this tool: #20277-5

#3 Updated by Pedro Venâncio about 6 years ago

I also confirm this one on Windows 10, not just with r.texture.

Processing algorithm…
Algorithm 'r.mapcalculator' starting…
Input parameters:
{ 'GRASS_RASTER_FORMAT_META' : '', 'GRASS_RASTER_FORMAT_OPT' : '', 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'a' : 'D:/MDT/SRTM_80m_JAG/dem_srtm_pttm06_80m.tif', 'b' : None, 'c' : None, 'd' : None, 'e' : None, 'expression' : ' A*2', 'f' : None, 'output' : 'C:/Users/PedroVenancio/AppData/Local/Temp/processing_f598f058848044b8bc2f4cad464ccf64/3e5c2b3aa62949c7ad5041c3a0f2879d/output.tif' }

g.region n=0.0 s=0.0 e=0.0 w=0.0 res=100.0
r.mapcalculator a=rast_5be372a24a7414 expression=" A*2" output=outputd617677f2c85414285c9278aa3f8ca0d --overwrite
g.region raster=outputd617677f2c85414285c9278aa3f8ca0d
r.out.gdal -t -m input="outputd617677f2c85414285c9278aa3f8ca0d" output="C:\Users\PedroVenancio\AppData\Local\Temp\processing_f598f058848044b8bc2f4cad464ccf64\3e5c2b3aa62949c7ad5041c3a0f2879d\output.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\PedroVenancio\AppData\Local\Temp\processing_f598f058848044b8bc2f4cad464ccf64\grassdata\grass_batch_job.cmd> ...
C:\OSGeo4W64\bin>chcp 1252 1>NUL
C:\OSGeo4W64\bin>g.region n=0.0 s=0.0 e=0.0 w=0.0 res=100.0
ERROR: North must be larger than South
C:\OSGeo4W64\bin>r.mapcalculator a=rast_5be372a24a7414 expression=" A*2" output=outputd617677f2c85414285c9278aa3f8ca0d --overwrite
Execution of <C:\Users\PedroVenancio\AppData\Local\Temp\processing_f598f058848044b8bc2f4cad464ccf64\grassdata\grass_batch_job.cmd> finished.
Cleaning up temporary files...
Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\processing\algs\grass7\Grass7Algorithm.py", line 415, in processAlgorithm
Grass7Utils.executeGrass(self.commands, feedback, self.outputCommands)
File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\processing\algs\grass7\Grass7Utils.py", line 408, in executeGrass
startupinfo=si if isWindows() else None
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
OSError: [WinError 87] O parâmetro está incorreto

Execution failed after 3.60 seconds

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

Giovanni, can you update the title to remove the reference to r.texture module?

#4 Updated by Jürgen Fischer about 6 years ago

  • Duplicates Bug report #20146: QGIS 3.2.3 Bonn and GRASS 7. r.texture does not provide any output. added

#5 Updated by Jürgen Fischer about 6 years ago

  • Status changed from Open to Closed
  • Resolution set to duplicate

#6 Updated by Jürgen Fischer about 6 years ago

  • Description updated (diff)

Also available in: Atom PDF