I'm really quite new to QGIS, I want to style polygons fill with raster imagws based on a attribute contained in the property table.

attribute table

What do I have to write in the description in order to get for each polygon the appropriate raster image?

enter image description here

  • Do you have the full path to the files in your field? And you might try the "/" and not the "\" even in windows. – Matte Apr 20 '16 at 10:26
  • jep I've tried that with no result I thought that I need to include some simple rule like if name = icon , file path but since I have no experience in coding I was wondering with wath expression to up – Anton Buhler Apr 20 '16 at 13:51
  • I have created a data set similar in format to the above, and managed to style the layer using exactly the same method as you have attempted. The description/file-path should remain empty as long as the full file path exists in the attribute. – ProudGIS Apr 20 '16 at 14:37
  • cool and what exactly else did you do? to be more precise the polygon collection is a .kml file, which links to the raster images in that specific folder. For some reason I can't edit the attribute table – Anton Buhler Apr 20 '16 at 19:37

I'm still confident that the issue is the file path in attribute 'icon' (seeing as this method has worked on a data-set my end). Could you post an example string from this attribute so we can see if it should work? If this is the issue, or if you are having trouble editing this attribute, as you say above, I would recommend re-creating the attribute using concat.

  • Open the attribute table and click 'open field calculator'
  • Select create new field, give it a name, change field type to Text and output field width to a large number(to avoid cutting the full filepath)
  • Add concat('full_directory',"Name",'.png')
  • Example below:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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