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.09k stars 2.93k forks source link

"Contour" returns error if output is temporary (wrong parameter passed?) #54952

Closed gioman closed 9 months ago

gioman commented 9 months ago

What is the bug or the crash?

The "contour" tool in the Processing toolbox seems to have lost the ability to output to temp file. If specifying an real output (i.e. gpkg or shp) it works as expected. The problem seems to be to be the parameter-f "Interlis 2" that it passed, and probably should not:

GDAL command:
gdal_contour -b 1 -a ELEV -i 200.0 -f "Interlis 2" GPKG:C:/Users/giovanni/Desktop/SVR/test.gpkg:mdt C:/Users/giovanni/AppData/Local/Temp/processing_GXQWCj/cdcbd9ff07604c918419db19f781250c/OUTPUT.xtf
GDAL command output:
Warning 1: Model file not specified.
Process returned error code 1
Execution completed in 0.36 seconds
Results:
{'OUTPUT': 'C:/Users/giovanni/AppData/Local/Temp/processing_GXQWCj/cdcbd9ff07604c918419db19f781250c/OUTPUT.xtf'}

Loading resulting layers
The following layers were not correctly generated.
• C:/Users/giovanni/AppData/Local/Temp/processing_GXQWCj/cdcbd9ff07604c918419db19f781250c/OUTPUT.xtf
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Steps to reproduce the issue

Add a DEM to a project and try extract the contour with a temp output.

Versions

3.28.11 3.32.3

Windows 11.

Supported QGIS version

New profile

Additional context

No response

alexbruy commented 9 months ago

-f "Interlis 2" is passed because you seem have "Interlis 2" set as a default output format.

gioman commented 9 months ago

@alexbruy that was the case, anyway is very strange I never changed that option and in fact this was also observed on other people machines where QGIS was only recently installed.

agiudiceandrea commented 9 months ago

It seems a recurring issue. I've seen various users reports on forums and facebook groups about the issue due to that setting they actually didn't set.

agiudiceandrea commented 8 months ago

Another issue report about the xtf "Interlis 2" default output vector format: https://github.com/qgis/QGIS/issues/55110.

agiudiceandrea commented 5 months ago

Another issue report about the nc default output raster format: https://lists.osgeo.org/pipermail/qgis-user/2024-January/053885.html

agiudiceandrea commented 5 months ago

Other reports about the "Interlis 2" (.xtf) default output vector format and the "NetCDF" (.nc) default output raster vector format issue: https://www.facebook.com/groups/qgiscommunityofficialvirtualgroup/posts/2523886831123186/ https://www.facebook.com/groups/qgiscommunityofficialvirtualgroup/posts/2534859280025941/ https://www.facebook.com/groups/GisItalia/posts/10161207159211385/ https://www.facebook.com/groups/GisItalia/posts/10161423743961385

agiudiceandrea commented 4 months ago

Other reports about the "Interlis 2" (.xtf) default output vector format issue: https://gis.stackexchange.com/questions/463507/contour-polygons-warning-model-file-not-specified https://gis.stackexchange.com/questions/477614/polygonize-error https://gis.stackexchange.com/questions/474162/qgis-converting-simple-png-raster-file-yields-warning-1-model-file-not-specifi https://gis.stackexchange.com/questions/463099/clip-raster-by-mask-layer-attempt-gives-error-1-netcdf-chunk-fetch-failed https://gis.stackexchange.com/questions/467079/qgis-polygonize-tool-error

kannes commented 4 months ago

xtf and nc are the last entries in the lists for Processing's "Default output [raster|vector] layer extension".

In those buggy profiles where the xtf and nc are erroneously used, the QGIS3.ini contains:

Configuration\DefaultOutputRasterLayerExt=-1
Configuration\DefaultOutputVectorLayerExt=-1

There is some code catching that and use the wanted defaults (gpkg and tif) but I guess there is a bug with the population of the combobox of chooseble formats in the Processing options.

agiudiceandrea commented 4 months ago

Thanks @kannes for looking at this. I also suggested the same root cause in a recent message to the qgis-developer mailing list https://lists.osgeo.org/pipermail/qgis-developer/2024-February/066539.html. See also https://github.com/qgis/QGIS/pull/53458.

agiudiceandrea commented 4 months ago

Other recent issue reports: https://github.com/qgis/QGIS/issues/56588, https://gis.stackexchange.com/questions/478050/raster-to-vector-bunch-of-errors/, https://lists.osgeo.org/pipermail/qgis-user/2024-March/054176.html.

ar-siddiqui commented 3 months ago

A lot of people are reporting this issue for different plugins, they do not remember explicitly changing the settings. Has there been a solution proposed?

agiudiceandrea commented 3 months ago

@ar-siddiqui, if you have experienced the issue about the settings change without your consent, please open an issue report or inform the qgis-developer mailing list replaying to the at thread https://lists.osgeo.org/pipermail/qgis-developer/2024-February/066539.html. If other user have experienced such issue, please ask them to open an issue report.

agiudiceandrea commented 2 months ago

Other issue reports: https://github.com/qgis/QGIS/issues/54375, https://github.com/qgis/QGIS/issues/55110#issuecomment-1873415345, https://github.com/qgis/QGIS/issues/57250, https://github.com/qgis/QGIS/issues/57267.

ar-siddiqui commented 1 month ago

I ran into this issue today as well. I did not change any settings or installed any plugins that might have updated the settings.

ar-siddiqui commented 1 month ago

Why has this issue been closed, please reopen this as many people are observing and reporting this. @agiudiceandrea

agiudiceandrea commented 1 month ago

@ar-siddiqui, this issue report has been closed by the reporter, since this specific issue has been fixed by himself just reverting the default output vector extension to the default value. You can open a new issue report about the unexpected setting change.

ar-siddiqui commented 1 month ago

A master issue has been created to track this bug https://github.com/qgis/QGIS/issues/57676