Skip to main content
added more example
Source Link
Ian Turton
  • 83.2k
  • 6
  • 89
  • 189

You need to construct the point you would like the label to appear from your X and Y columns and then tell the RuleTextSymbolizer to use that geometry to place the label.

I would use something like:

<Geometry><se:TextSymbolizer>
  <se:Geometry>
    <ogc:Function name="geomFromWKT">
      <ogc:Function name="Concatenate">"Point(",ogc:PropertyName(X)," ", ogc:PropertyName(Y),")"</ogc:Function>
    </ogc:Function>
  </se:Geometry>
  <se:Label>
     <ogc:Function name="strToUpperCase">
       <ogc:PropertyName>name_old</ogc:PropertyName>
     </ogc:Function>
   </se:Label>

A full list and description of the available functions is here.

You need to construct the point you would like the label to appear from your X and Y columns and then tell the Rule to use that geometry to place the label.

I would use something like:

<Geometry>
  <ogc:Function name="geomFromWKT">
    <ogc:Function name="Concatenate">"Point(",ogc:PropertyName(X)," ", ogc:PropertyName(Y),")"</ogc:Function>
  </ogc:Function>
</Geometry>

A full list and description of the available functions is here.

You need to construct the point you would like the label to appear from your X and Y columns and then tell the TextSymbolizer to use that geometry to place the label.

I would use something like:

<se:TextSymbolizer>
  <se:Geometry>
    <ogc:Function name="geomFromWKT">
      <ogc:Function name="Concatenate">"Point(",ogc:PropertyName(X)," ", ogc:PropertyName(Y),")"</ogc:Function>
    </ogc:Function>
  </se:Geometry>
  <se:Label>
     <ogc:Function name="strToUpperCase">
       <ogc:PropertyName>name_old</ogc:PropertyName>
     </ogc:Function>
   </se:Label>

A full list and description of the available functions is here.

Source Link
Ian Turton
  • 83.2k
  • 6
  • 89
  • 189

You need to construct the point you would like the label to appear from your X and Y columns and then tell the Rule to use that geometry to place the label.

I would use something like:

<Geometry>
  <ogc:Function name="geomFromWKT">
    <ogc:Function name="Concatenate">"Point(",ogc:PropertyName(X)," ", ogc:PropertyName(Y),")"</ogc:Function>
  </ogc:Function>
</Geometry>

A full list and description of the available functions is here.