I want to create a module in Qgis, my raster calculator, I'm stuck in the moment as it is possible to read raster files, just like in Qgis. If we open the raster calculator Qgis, we see in the raster channel our raster files with which we can perform mathematical operations
In my code it reads the raster channel as plain text
def run(self):
"""Run method that performs all the real work"""
layer_list = []
layers = self.iface.legendInterface().layers()
for layer in layers:
layer_list.append(layer.name())
self.dlg.listWidget.addItems(layer_list)
# show the dialog
self.dlg.show()
# Run the dialog event loop
result = self.dlg.exec_()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
# substitute with your code.
pass
How now to specify what he would perceive in the listWidget, how exactly the raster (this is necessary so that later I could add the functions Gdal and read the channels of the raster)