For elevation lines, I would like to have a different style of
full: 1 m
half: 0.5 m
quarter: 0.25 and 0.75 m
lines. Manually, I managed to extract the different lines with the following via field calculator in the attibute table:
- Extract 1 m values: if( "ELEV" = floor( "ELEV" ),"ELEV", '')
- Extract 25, 50 and 75 cm values (name: “no1m”): if( "ELEV" = floor( "ELEV" ),'', "ELEV" )
- Exctract 50 cm values: if( ("no1m" - 0.5) = floor( "no1m" ), "no1m",'')
- Extract 0.25 and 0.75 values: if( ("no1m" - 0.5) = floor( "no1m" ),'',"no1m")
Now that I have that problem more frequently so I want to setup a QGIS layer style file to fasten the process of styling and labelling the elevation lines.
For the labels, it works to label the full lines by setting up the rule [if( "ELEV" = floor( "ELEV" ),"ELEV", '')] and for the half and quarter lines, I use a rule without filter but with label [if( "ELEV" = floor( "ELEV" ), '',"ELEV")]. Since I just want the 1 m labels to be larger, it is ok like that.
Now for the style, I can extract all 1 m lines with [if( "ELEV" = floor( "ELEV" ),"ELEV", '')] but as soon as I set a rule for the half m lines [if( "ELEV" = floor( "ELEV" ), '',"ELEV")], I dont see any lines. If I only click on one of the two labels, I can see it but together they seem to overrule each other and nothing is shown. How can this be solved? Also, how do I style the quarter lines in the rule based styling?