[QGIS-Developer] How to create temporary raster destination path in script?

Alexander Bruy alexander.bruy at gmail.com
Mon Aug 13 05:52:03 PDT 2018


Hi,

why not use generateTempFilename() from QgsProcessingUtils? And use this
path in algorithm.
пн, 13 серп. 2018 о 15:36 Rudi von Staden <rudivs at gmail.com> пише:
>
> Hi all,
>
> I'd like to create a temporary raster file in my script, but I don't want to add it as an output layer (it's an input to another step of the process). Is there some tooling to create the path (e.g. to pass as output parameters to algorithms called with processing.run) outside of using `self.parameterAsOutputLayer`?
>
> Using `QgsApplication.processingRegistry().parameterType('rasterDestination')` seemed promising, but I haven't been able to get an output path from that.
>
> If not, I can just roll my own using os.environ['TMP'] but I would prefer to follow the QGIS coding practices where possible.
>
> Thanks,
> Rudi
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alexander Bruy


More information about the QGIS-Developer mailing list