11

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>
11

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, privacy policy and cookie policy

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