I have a polygonised output of a raster file but need to add the raster filename to the attribute table of the polygon (vector) file. I can do this manually using the command 'base_layer_name' but I have many individual raster files and therefore need to automate this process within a model.

I am using the modeler within QGIS. I have a folder containing approx. 1000 raster files that I need to create individual polygons for further vector analysis (overlap, union etc.) with other polygons. I need to insert the filename of the raster into the attribute table of the polygon so that I can maintain the identity of the source data when outputs are created.


1 Answer 1


You can use Export layers(s) information to create a polygon layer of the raster extent with attributes like:

  • Raster layer name
  • Raster source

Then intersect this with your polygonized raster layer to add the columns to your polygonized raster:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.