Azad Rasul
SmartRS

SmartRS

5- Loading raster files

Azad Rasul's photo
Azad Rasul

Published on Jun 25, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

For loading raster files, GDAL library is used.

Firstly, download the data.

Then, get the path of the raster file:

uri = "D:/Python_QGIS/data/dem_subset.tif"

Now add the layer

The format is:

rlayer = iface.addRasterLayer(data_source, layer_name, provider_name)

rlayer = iface.addRasterLayer(uri, "my_raster", "gdal")
 
Share this
Proudly part of