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

Alexander Bruy alexander.bruy at gmail.com
Mon Aug 6 03:49:40 PDT 2018


Hi Frank,

there is nothing wrong or strange here. First, Processing automatically adds
suffixes to the output filenames if wrong or no suffix specified. And second,
".tif" is a standard suffix for TIFF files (whether georeferenced or not).

So when you specify filename with wrong ".gtiff" suffix Processing adds correct
one and your final filename has double suffix ".gtiff.tif".
пн, 6 серп. 2018 о 12:13 Frank Broniewski <hallo at frankbroniewski.com> пише:
>
> 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
>
> www.frankbroniewski.com
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



-- 
Alexander Bruy



More information about the Qgis-user mailing list