Tuesday, 16 August 2016

style - Building Expressions for QGIS Markers


I have a tab delimited text file with a column "Status". It can have values OFF-AIR or ON-AIR. How do I control the marker properties like colour or out-line using the expression building. I am not looking for categorized symbol, I need the expression. This is my syntax, but it is not working:


CASE WHEN  "STATUS"  = 'ON AIR' THEN  color_rgba(255,255,0,80)
WHEN "STATUS" = 'OFF AIR' THEN color_rgba(255,0,0,80)

END

enter image description here



Answer



Haven't come across this issue before but it seems to work if you use three single quotation marks for the values:


CASE WHEN "STATUS" = '''ON AIR''' THEN color_rgba(255,255,0,80) 
WHEN "STATUS" = '''OFF AIR''' THEN color_rgba(255,0,0,80)
END

Result



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...