I have to create a template project in QGIS to be taken into the field by others. The aim is, that the user only enters data but does not have to change styles or anything themselves.
I have a layer that represents different storeys of buildings. The storey number is stored as an attribute. To distinguish them better, I'd like to give different storeys different colours using a color ramp. However, I do not know, how many storeys the buildings recorded in this GIS may have. Given the highest buildings and deepest basements at the moment a range of about -50 to 200 should be sufficient in any case, but the usual numbers will certainly lie between -10 and 10. But I there is now way of telling in beforehand.
Is there a way to create a color ramp, that automatically reclassifies to fit the range given in the attribute column it takes the values from?
Best Answer
You can run this script in the Python Script Editor in QGIS and it will symbolise your layer with a colour ramp based on values in the
storeys
field.