InsideDarkWeb.com

gdalnumeric.LoadFile() with temporary output from QGIS algorithm

I’m trying to access a previously created temporary raster output with gdalnumeric.LoadFile() to calculate some statistics. It seems to me that gdalnumeric.LoadFile() can only access a file through a file path and not with a QGIS temporary output.

I tried without success:

import gdalnumeric
path="C:Users...xxx.gpkg"
raster = processing.run("gdal:rasterize", {'INPUT':path,'FIELD':'','BURN':1,'UNITS':1,'WIDTH':50,'HEIGHT':50,'EXTENT':'32351398.3019399,32593108.6666274,5366514.87416986,6045057.7298552 [EPSG:5652]','NODATA':0,'OPTIONS':'','DATA_TYPE':0,'INIT':None,'INVERT':False,'EXTRA':'','OUTPUT':'TEMPORARY_OUTPUT'})
raster_file = raster['OUTPUT']

Is there a way to access the temporary raster with gdalnumeric.LoadFile()? Or do I need to use a QGIS native algorithm to continue my analysis?

Geographic Information Systems Asked on November 21, 2021

1 Answers

One Answer

Why don't you change 'OUTPUT':'TEMPORARY_OUTPUT' to 'OUTPUT':'/tmp/myfile.tif' and then use gdalnumeric.LoadFile() on it?

Answered by ThomasG77 on November 21, 2021

Add your own answers!

Related Questions

What is the second argument in QgsProcessingUtils.mapLayerFromString()?

1  Asked on February 28, 2021 by francisco-bonnefoy

       

Fix “zigzags” in TIN surface (Civil 3D)

0  Asked on February 28, 2021

   

Can QGIS open the file type .pitemx or .pkinfo?

1  Asked on February 28, 2021 by sir-socks

   

How to calculate elevation angle between two GPS coordinates?

1  Asked on February 28, 2021 by hesham-k

   

Invalid geometry type after clipping

0  Asked on February 28, 2021 by david-koller

     

Deleting layout pages in QGIS 3

1  Asked on February 27, 2021 by darryl

 

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.