Bug report #21978

GDALTools - Processing dialog: Generates file names not enclosed, wrong options, and lacks free option support

Added by Sfkeller - over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GDAL Tools
Affected QGIS version:3.6.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29793

Description

Bug and feature request related to processing tool "GDAL Grid (Nearest Neighbor)" and possibly any other Grid processing tool.

Test case and goal is to call e.g. "gdal_grid" as follows:

gdal_grid -a nearest:radius1=1:radius2=1:nodata=-99 \
-txe 50 350 -tye 650 450 -outsize 3 2 -zfield z \
"grid in.gpkg" "grid out.tif"

1. (Bug) In file and out file names should be enclosed by parantheses, since they can contain white spaces (at least under Windows).

GDAL (e.g. gdal_grid) options like "-txe 50 350 -tye 650 450 -outsize 3 2" are unreachable in GUI.

2. (Bug) Using GUI section "Additional generation options [optional]" it currently generates wrong options like this "-co txe -co 50 -co 350 -co tye -co 650 -co 450 -co outsize -co 3 -co 2".

3. (Feature Request) It should be possible for the user to enter options as plain text. Think e.g. about the GDAL/OGR -sql parameter.

History

#1 Updated by Sfkeller - over 5 years ago

  • Subject changed from GDALTools - Grid: Options generate to GDALTools - Processing dialog: Generates file names not enclosed, wrong options, and lacks free option support

#2 Updated by Giovanni Manghi over 5 years ago

  • Operating System deleted (all)
  • Status changed from Open to Feedback

Sfkeller - wrote:

Bug and feature request related to processing tool "GDAL Grid (Nearest Neighbor)" and possibly any other Grid processing tool.

hi, please 1 bug/feature request per ticket, thanks.

1. (Bug) In file and out file names should be enclosed by parantheses, since they can contain white spaces (at least under Windows).

I just tried on Windows, and cannot replicate. The generated command in my case was:

gdal_grid -l "test test" -zfield id -a invdistnn:power=2.0:smothing=0.0:radius=1000.0:max_points=12:min_points=0:nodata=0.0 -ot Float32 -of GTiff "C:\\Users\\qgis\\Desktop\\test test.gpkg" C:/Users/qgis/AppData/Local/Temp/processing_57ac2b3dd6ce480db5e95e97965183b7/a4ee8a84c7a04b1a9b5b2c9149c079ee/OUTPUT.tif

and worked as expected (as you see the input path is correctly quoted so to handle spaces).

GDAL (e.g. gdal_grid) options like "-txe 50 350 -tye 650 450 -outsize 3 2" are unreachable in GUI.

feature request.

2. (Bug) Using GUI section "Additional generation options [optional]" it currently generates wrong options like this "-co txe -co 50 -co 350 -co tye -co 650 -co 450 -co outsize -co 3 -co 2".

how? the "Additional generation options [optional]" option has a few pre-defined lco (layer creation options), none of them looks like the ones you say. The user can manually add LCOs (they are related to the output format, not the gdal tool being used) and there is even a button the validate them before running the tool.

3. (Feature Request) It should be possible for the user to enter options as plain text. Think e.g. about the GDAL/OGR -sql parameter.

there is already a similar feature request.

#3 Updated by Sfkeller - over 5 years ago

Thanks for taking care of this issue.

Sfkeller (I) - wrote:

Bug and feature request related to processing tool "GDAL Grid (Nearest Neighbor)" and possibly any other Grid processing tool.

Test case and goal is to call e.g. "gdal_grid" as follows:

gdal_grid -a nearest:radius1=1:radius2=1:nodata=-99 \
-txe 50 350 -tye 650 450 -outsize 3 2 -zfield z \
"grid in.gpkg" "grid out.tif"

1. (Bug) In file and out file names should be enclosed by parantheses, since they can contain white spaces (at least under Windows).

This is an example what QGIS generated in my case (the input file was a .CSV file:

gdal_grid -l None -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot UInt16 -of GTiff -co txe=50 -co 350 file:///C:/Daten/daten_eigene2/_Hektarraster/in%20file.csv?type=csv&delimiter=;&detectTypes=yes&xField=X&yField=Y&crs=EPSG:2056&spatialIndex=no&subsetIndex=no&watchFile=no C:/Users/sfkeller/AppData/Local/Temp/processing_8287a5d5d1714b048a483cbc87d6a053/785331c3e32e41ecb5c3807a7087257e/OUTPUT.tif

As one can see "file:///C:/Daten..." is not quoted and leads to an error when executed.

GDAL (e.g. gdal_grid) options like "-txe 50 350 -tye 650 450 -outsize 3 2" are unreachable in GUI.

2. (Bug) Using GUI section "Additional generation options [optional]" it currently generates wrong options like this "-co txe -co 50 -co 350 -co tye -co 650 -co 450 -co outsize -co 3 -co 2".

See example above where I entered (on purpose) "txe" as key option and "50 350" as value.
That is is probably covered by the feature request below.

3. (Feature Request) It should be possible for the user to enter options as plain text. Think e.g. about the GDAL/OGR -sql parameter.

Can't find a similar feature request. Have to double check again.

#4 Updated by Giovanni Manghi over 5 years ago

gdal_grid -l None -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot UInt16 -of GTiff -co txe=50 -co 350 file:///C:/Daten/daten_eigene2/_Hektarraster/in%20file.csv?type=csv&delimiter=;&detectTypes=yes&xField=X&yField=Y&crs=EPSG:2056&spatialIndex=no&subsetIndex=no&watchFile=no C:/Users/sfkeller/AppData/Local/Temp/processing_8287a5d5d1714b048a483cbc87d6a053/785331c3e32e41ecb5c3807a7087257e/OUTPUT.tif

GDAL does not know anything (I guess) about what is a QGIS delimited text layer, so my bet is that this won't work anyway.

GDAL (e.g. gdal_grid) options like "-txe 50 350 -tye 650 450 -outsize 3 2" are unreachable in GUI.

2. (Bug) Using GUI section "Additional generation options [optional]" it currently generates wrong options like this "-co txe -co 50 -co 350 -co tye -co 650 -co 450 -co outsize -co 3 -co 2".

See example above where I entered (on purpose) "txe" as key option and "50 350" as value.
That is is probably covered by the feature request below.

the "txe" parameter (for example) is a gdal_grid parameter, not a lco (layer creation option): LCOs are specific of the output format that is being used. For example if you are outputting to geotiff https://www.gdal.org/frmt_gtiff.html (see "creation options").

The parameters you are asking can be added anyway to the module GUI, please file a feature request.

3. (Feature Request) It should be possible for the user to enter options as plain text. Think e.g. about the GDAL/OGR -sql parameter.

Can't find a similar feature request. Have to double check again.

#11323

edit interactively the GDAL commands was possible in the now obsolete "GDAL tools" core plugin. In Processing this was never implemented as I think its not obvious.

#5 Updated by Sfkeller - over 5 years ago

Thx. I've added a comment at #11323. You can close this ticket.

#6 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

Sfkeller - wrote:

Thx. I've added a comment at #11323. You can close this ticket.

you need to open a feature request asking to add the parameters txe, tye, etc for the gdal_grid tools.

Also available in: Atom PDF