qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.6k stars 3.01k forks source link

GRASS `v.surf.rst` error in Windows: not creating interpolated elevation layer #57523

Closed carnendil closed 5 months ago

carnendil commented 5 months ago

What is the bug or the crash?

Running v.surf.rst on a point cloud in MS Windows 10, results in the following error and the output file is not created:

ERROR: Raster map or group <elevationXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX> not found`

An attribute field is selected and a raster mask is used. All output is omitted with the exception of interpolated RST, which would be saved to a file. All other options are left unchanged.

Running the same on Ubuntu works without any errors (same input data, same QGIS version).

Full run output (on Windows):

Versión de QGIS: 3.34.6-Prizren
Revisión del código de QGIS: 623828f5
Versión de Qt: 5.15.13
Python version: 3.12.3
Versión de GDAL: 3.8.5
Versión de GEOS: 3.12.1-CAPI-1.18.1
Versión de PROJ: Rel. 9.4.0, March 1st, 2024
PDAL version: 2.6.3 (git-version: 816ce1)
El algoritmo comenzó en: 2024-05-21T14:01:58
Algoritmo 'v.surf.rst' comenzando…
Parámetros de entrada:
{ '-d' : False, '-t' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_RASTER_FORMAT_META' : '', 'GRASS_RASTER_FORMAT_OPT' : '', 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_EXPORT_NOCAT' : False, 'GRASS_VECTOR_LCO' : '', 'dmax' : None, 'dmin' : None, 'elevation' : 'D:/Datos de usuario/Documents/sigdata/lt138kv_epz-blf2/lasdata/T2_SE_BLF2_las2txtxyz_grass_v-surf-srt.sdat', 'input' : 'D:\\Datos de usuario\\Documents\\sigdata\\lt138kv_epz-blf2\\lasdata\\T2_SE_BLF2_las2txtxyz.gpkg|layername=t2_se_blf2_las2txt', 'mask' : 'D:/Datos de usuario/Documents/sigdata/lt138kv_epz-blf2/lasdata/T2_SE_BLF2_las2txtxyz_sagang_polygons-to-grid.sdat', 'npmin' : 300, 'scalex' : None, 'segmax' : 40, 'smooth' : None, 'smooth_column' : '', 'tension' : 40, 'theta' : None, 'where' : '', 'zcolumn' : 'field_3', 'zscale' : 1 }

g.proj -c wkt="C:/Users/Rainer.Parrales/AppData/Local/Temp/processing_hJPUaA/6a0626b0c2674eee8f94a79b83683076/crs.prj"
v.in.ogr min_area=0.0001 snap=-1.0 input="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz.gpkg" layer="t2_se_blf2_las2txt" output="vector_664cfdb63162b10" --overwrite -o
r.in.gdal input="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz_sagang_polygons-to-grid.sdat" band=1 output="rast_664cfdb63162b11" --overwrite -o
g.region n=1327920.5 s=1327369.5 e=194370.5 w=193819.5 res=1.0
v.surf.rst input=vector_664cfdb63162b10 zcolumn=field_3 mask=rast_664cfdb63162b11 tension=40 segmax=40 npmin=300 zscale=1 elevation=elevation49daad50cc854da6b0802d188a20932c --overwrite
g.region raster=elevation49daad50cc854da6b0802d188a20932c
r.out.gdal -t -m input="elevation49daad50cc854da6b0802d188a20932c" output="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz_grass_v-surf-srt.sdat" format="SAGA" --overwrite
C:\OSGeo4W\apps\grass\grass83\etc\grass83.py:298: SyntaxWarning: invalid escape sequence '\.'
"%([#0 +-]*)([0-9]*)(\.[0-9]*)?([hlL]?[diouxXeEfFgGcrsa%])", fmt
WARNING: Concurrent mapset locking is not supported on Windows
D:\Datos de usuario\Documents>chcp 1252 1>NUL
D:\Datos de usuario\Documents>g.proj -c wkt="C:/Users/Rainer.Parrales/AppData/Local/Temp/processing_hJPUaA/6a0626b0c2674eee8f94a79b83683076/crs.prj"
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
D:\Datos de usuario\Documents>v.in.ogr min_area=0.0001 snap=-1.0 input="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz.gpkg" layer="t2_se_blf2_las2txt" output="vector_664cfdb63162b10" --overwrite -o
Over-riding projection check
Check if OGR layer <t2_se_blf2_las2txt> contains polygons...
0..2..4..6..8..10..12..14..16..18..20..22..24..26..28..30..32..34..36..38..40..42..44..46..48..50..52..54..56..58..60..62..64..66..68..70..72..74..76..78..80..82..84..86..88..90..92..94..96..98..100
Creating attribute table for layer <t2_se_blf2_las2txt>...
Importing 9534 features (OGR layer <t2_se_blf2_las2txt>)...
0..2..4..6..8..10..12..14..16..18..20..22..24..26..28..30..32..34..36..38..40..42..44..46..48..50..52..54..56..58..60..62..64..66..68..70..72..74..76..78..80..82..84..86..88..90..92..94..96..98..100
-----------------------------------------------------
Building topology for vector map <vector_664cfdb63162b10@PERMANENT>...
Registering primitives...
D:\Datos de usuario\Documents>r.in.gdal input="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz_sagang_polygons-to-grid.sdat" band=1 output="rast_664cfdb63162b11" --overwrite -o
Over-riding projection check
Importing raster map <rast_664cfdb63162b11>...
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
D:\Datos de usuario\Documents>g.region n=1327920.5 s=1327369.5 e=194370.5 w=193819.5 res=1.0
D:\Datos de usuario\Documents>v.surf.rst input=vector_664cfdb63162b10 zcolumn=field_3 mask=rast_664cfdb63162b11 tension=40 segmax=40 npmin=300 zscale=1 elevation=elevation49daad50cc854da6b0802d188a20932c --overwrite
D:\Datos de usuario\Documents>g.region raster=elevation49daad50cc854da6b0802d188a20932c
ERROR: Raster map <elevation49daad50cc854da6b0802d188a20932c> not found
D:\Datos de usuario\Documents>r.out.gdal -t -m input="elevation49daad50cc854da6b0802d188a20932c" output="D:\Datos de usuario\Documents\sigdata\lt138kv_epz-blf2\lasdata\T2_SE_BLF2_las2txtxyz_grass_v-surf-srt.sdat" format="SAGA" --overwrite
ERROR: Raster map or group <elevation49daad50cc854da6b0802d188a20932c> not found
D:\Datos de usuario\Documents>exit
Presione una tecla para continuar . . .
Execution completed in 4.29 segundos
Resultados:
{'elevation': 'D:\\Datos de '
'usuario\\Documents\\sigdata\\lt138kv_epz-blf2\\lasdata\\T2_SE_BLF2_las2txtxyz_grass_v-surf-srt.sdat'}

Cargando las capas resultantes
Las siguientes capas no se generaron correctamente.
• D:/Datos de usuario/Documents/sigdata/lt138kv_epz-blf2/lasdata/T2_SE_BLF2_las2txtxyz_grass_v-surf-srt.sdat
Puede comprobar el «Panel de mensajes del registro» en la ventana principal de QGIS para encontrar más información sobre la ejecución del algoritmo.

Steps to reproduce the issue

  1. From the Processing Toolbox launch the v.surf.rst algorithm.
  2. Select the input points layer (a .gpkg layer in my case).
  3. Select the "Name of the attribute column with values tu be used for approximation". Elevation data column in my case.
  4. Select the "Name of the raster map used as a mask". In my case, a .sdat raster containing a single polygon. All points are contained within that polygon.
  5. For "Interpolated RST", select "Save to file..." and give a name to the output file.
  6. For all other outputs (Slope, Aspect, Profile curvature, Tangential curvature, Mean curvature, Deviations, Quadtree segmentation, and Overlapping windows), select "Omit output".
  7. Run the algorithm.

Versions

Versión de QGIS 3.34.6-Prizren Revisión del código de QGIS 623828f5
Versión Qt 5.15.13
Versión de Python 3.12.3
Versión de GDAL/OGR 3.8.5
Versión de PROJ 9.4.0
Versión del registro de base de datos EPSG v11.004 (2024-02-24)
Versión de GEOS 3.12.1-CAPI-1.18.1
Versión de SQLite 3.45.1
Versión de PDAL 2.6.3
Versión del cliente de PostgreSQL 16.2
Versión de SpatiaLite 5.1.0
Versión de QWT 6.2.0
Versión de QScintilla2 2.14.1
Versión del SO Windows 10 Version 2009
Complementos activos de Python
LAStools 2.1.0
processing_saga_nextgen 1.0.0
QuickOSM 2.2.3
quick_map_services 0.19.34
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99

Supported QGIS version

New profile

Additional context

I didn't find any other bug or issue about this error, so I create a new one.

I also tried with a different dataset, one for which in Feb. 2023 (possibly QGIS 3.28) the very same procedure had worked perfectly. This time I got the same error described above. It shows that is not a problem with the data, but QGIS/GRASS behaving differently.

The algorithm ran without major problems in Ubuntu (although it gave a warning to change/set, I think, GRASS region, because the "too long time to find interpolation points", and an error pertaining the selected output file format: "SetColorTable() only supported for Byte or UInt16 bands in TIFF format.").

Ubuntu's package version differences are: python 3.11.6, GDAL 3.7.1, and PROJ 9.2.1.

agiudiceandrea commented 5 months ago

@carnendil, thanks for reporting. It would be useful if you provided the layers with which the issue occurs and if you specify all the algorithm parameters and the GRASS version with which the issue occurs and the GRASS version with which the issue doesn't occur.

carnendil commented 5 months ago

@agiudiceandrea thank you for your reply.

the layers with which the issue occurs

Check attached zip file las2txtxyz.zip

the GRASS version with which the issue occurs

8.3.2 (output from running print(Grass7Utils.installedVersion()) in the Python console)

the GRASS version with which the issue doesn't occur

8.3.0

specify all the algorithm parameters

agiudiceandrea commented 5 months ago

@carnendil, thanks for providing the test layers and alg's parameters. It looks like the issue is due to the crash of the GRASS-GIS 8.3 program v.surf.rst.exe (from OSGeo4W) and the Windows module ntdll.dll on Windows with the following error:

Nome registro: Application
Origine:       Application Error
Data:          
ID evento:     1000
Categoria attività:(100)
Livello:       Errore
Parole chiave: Classico
Utente:        N/D
Computer:      
Descrizione:
Nome dell'applicazione che ha generato l'errore: v.surf.rst.exe, versione: 8.3.0.0, timestamp: 0x656ba046
Nome del modulo che ha generato l'errore: ntdll.dll, versione: 10.0.18362.778, timestamp: 0x0c1bb301
Codice eccezione: 0xc0000374
Offset errore 0x00000000000f9229
ID processo che ha generato l'errore: 0x1064
Ora di avvio dell'applicazione che ha generato l'errore: 0x01daae2a1a76729a
Percorso dell'applicazione che ha generato l'errore: C:\OS2019~1\apps\grass\grass83\bin\v.surf.rst.exe
Percorso del modulo che ha generato l'errore: C:\WINDOWS\SYSTEM32\ntdll.dll
ID segnalazione: 0b98d9be-1f83-4919-8618-24bfe91af48b

The issue doesn't occur using GRASS-GIS 7.8.6.

It seems to me the error is not in QGIS itself but either in GRASS-GIS 8.3 or in the GRASS-GIS 8.3 package provided by OSGeo4W or in the Windows OS. Thus I think it would be better to report the issue to the GRASS-GIS developers https://github.com/OSGeo/grass or to the OSGeo4W project team https://trac.osgeo.org/osgeo4w/.

carnendil commented 5 months ago

@agiudiceandrea thank you very much for your answer.

I'll follow up as you suggest and, just for closure, will report back here whatever is achieved over there.

agiudiceandrea commented 5 months ago

The issue occurs on Windows even directly using the GRASS-GIS 8.3.2 GUI (OSGeo4W), thus it is not due to QGIS.

conster303 commented 2 months ago

same issue