12

Using Geoserver, is there any way that I can add a predefined string: "No. " to a property: postalnumber?

<sld:Label>
<ogc:PropertyName>postalnumber</ogc:PropertyName>
</sld:Label>

1 Answer 1

14

The SLD spec includes a string concatenation function. Here's an example of how to use it with labels:

         <Label>
            <ogc:Function name="Concatenate">
              <ogc:Literal>No. </ogc:Literal>
              <ogc:PropertyName>postalNumber</ogc:PropertyName>
            </ogc:Function>
          </Label>

The above was tested on geoserver version 2.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.