[Qgis-user] processing.run gdal file extension fun

Frank Broniewski hallo at frankbroniewski.com
Mon Aug 6 02:13:14 PDT 2018


Hi all,

 

My question is probably more for the devs: I am developing a processing
script to do some work on SRMT elevation scenes. I want to use some
GDAL-tools to do the task, my first is filling the scene with
gdal:fillnodata.

 

My processing run-task is as follows:

        params = {

            'INPUT': input_evelation,

            'BAND': 1,

            'DISTANCE': 10,

            'ITERATIONS': 0,

            'NO_MASK': False,

            'OUTPUT':
QgsProcessingUtils.generateTempFilename('filled.gtiff')

        }

        filled = processing.run('gdal:fillnodata', params, context=context,

                                feedback=feedback)['OUTPUT']

 

Usually I use “gtiff” as extension for GeoTIFF files, just to make it
obvious that the file is a geotiff and not a standard one. I was getting
missing file errors and could not understand why the output file could not
be found. This was giving me some headaches. Then, just for the fun I tried
changing 

 

'OUTPUT': QgsProcessingUtils.generateTempFilename('filled.gtiff') -> to ->
'OUTPUT': QgsProcessingUtils.generateTempFilename('filled.tif')

 

and it works!

 

Simply by using the TIF (*.tif) file extension the script runs through. This
caught me totally by surprise, is this intentionally or some kind of
oversight? Shouldn’t this be kind of irrelevant which naming convention the
output follows?

 

Frank

 

 

Dipl. Geogr. Frank Broniewski

Waldhölzbacher Str. 51

66679 Losheim am See

06872 509 068 4

0176 611 26 9 2 6

 <http://www.frankbroniewski.com> www.frankbroniewski.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180806/f84a8c20/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5488 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180806/f84a8c20/attachment.bin>


More information about the Qgis-user mailing list