How to concatenate two labels (one string and one double type) in my sld code?

849 Views Asked by At

I'm creating a style in geoserver and need to concatenate two different data type (one is string, the other is double) but it's not working. someone can help me? i'm using geoserver 2.16 version and here's the code i've made:

 <se:Label>
    <ogc:PropertyName>name</ogc:PropertyName>
   (<ogc:PropertyName>number</ogc:PropertyName>)
 </se:Label>
1

There are 1 best solutions below

0
On

You can concatenate the two of them by using the funcion <ogc:Function name="Concatenate">

For example, in your case, it would be:

<se:Label>
   <ogc:Function name="Concatenate">
       <ogc:PropertyName>name</ogc:PropertyName>
       <ogc:PropertyName>number</ogc:PropertyName>
   </ogc:Function>
</se:Label>