I have a style that divide features in PostGIS layer to four categories based on atributte Z_KAT. In the fourth category I want to specify that Z_KAT is equal to '04' OR null value.
Condition for text value '04' works well but condition for null value doesn't work (only selected features with value '04'). In SLD it works well so I can compare the result in "layer preview" but i need the style in CSS.
I also tried something like this: Problem with NotEqualTo filters in SLD and CSS but without success.
How can I get this to work?
Version of GeoServer and CSS extension is 2.16.2.
Here is my code:
/* @title Vodní nádrž I. kategorie TBD*/
[Z_KAT='01']{
mark: symbol(square);
mark-size: 7;
mark-rotation: 45;
:mark{
fill: #ff0000;
}
}
/* @title Vodní nádrž II. kategorie TBD*/
[Z_KAT='02']{
mark: symbol(square);
mark-size: 7;
mark-rotation: 45;
:mark{
fill: #008080;
}
}
/* @title Vodní nádrž III. kategorie TBD*/
[Z_KAT='03']{
mark: symbol(square);
mark-size: 7;
mark-rotation: 45;
:mark{
fill: #00ffff;
}
}
/* @title Vodní nádrž IV. kategorie TBD*/
[Z_KAT='04'],[Z_KAT is Null]{
mark: symbol(square);
mark-size: 7;
mark-rotation: 45;
:mark{
fill: #0000ff;
}
}
coalesce
function in a single term (equivalent toWHERE coalesce(Z_CAT,'04') = '04'
)