We have a specific use case to color code WMS based on number of specific attribute in complex features. e.g. if there is 1 xyz attribute -> color red, if there are 2 xyz attributes -> color blue, etc. For this I picked up existing LengthFunction in gt-main. I am not really sure the difference between this and strLength function (except strLength is a FilterFunction). Anyway, I made it return number of attributes for complex attributes. If the text length is what users are after, they should be using strLength. Usage in test example: <sld:CssParameter name="fill"> <ogc:Function name="Recode"> <!-- Value to transform --> <ogc:Function name="length"> <ogc:PropertyName>gsml:specification/gsml:GeologicUnit/gsml:occurrence</ogc:PropertyName> </ogc:Function> <ogc:Literal>1</ogc:Literal> <!-- yellow --> <ogc:Literal>#ffff00</ogc:Literal> <ogc:Literal>2</ogc:Literal> <!-- blue --> <ogc:Literal>#0000ff</ogc:Literal> <ogc:Literal>3</ogc:Literal> <!-- red --> <ogc:Literal>#ff0000</ogc:Literal> </ogc:Function> </sld:CssParameter> |