0

I would like to change place of polygon label to X place:

enter image description here

Which function should I use? doesn’t change the position. The label is still in the centere of polygon..

<se:Rule>
  <se:MinScaleDenominator>1</se:MinScaleDenominator>
  <se:MaxScaleDenominator>25000</se:MaxScaleDenominator>
  <se:TextSymbolizer>
    <se:Label>
      <ogc:PropertyName>kod_reb</ogc:PropertyName>
    </se:Label>
    <se:Font>
      <se:SvgParameter name="font-family">Times New Roman</se:SvgParameter>
      <se:SvgParameter name="font-size">10</se:SvgParameter>
    </se:Font>
    <se:LabelPlacement>
      <se:PointPlacement>
        <se:AnchorPoint>
          <se:AnchorPointX>0.5</se:AnchorPointX>
          <se:AnchorPointY>0.5</se:AnchorPointY>
        <se:Displacement>
            <se:DisplacementX>-25</se:DisplacementX>
            <se:DisplacementY>-25</se:DisplacementY>
        </se:Displacement>
        </se:AnchorPoint> 
      </se:PointPlacement>
    </se:LabelPlacement>
    <se:Halo>
      <se:Radius>1</se:Radius>
      <se:Fill>
        <se:SvgParameter name="fill">#ffffff</se:SvgParameter>
      </se:Fill>
    </se:Halo>
    <se:Fill>
      <se:SvgParameter name="fill">#ff0000</se:SvgParameter>
    </se:Fill>
  </se:TextSymbolizer>
</se:Rule>

o Can you tell me what is wrong? :(

<se:Rule>
  <se:MinScaleDenominator>1</se:MinScaleDenominator>
  <se:MaxScaleDenominator>25000</se:MaxScaleDenominator>
  <se:TextSymbolizer>
    <se:Label>
      <ogc:PropertyName>kod_reb</ogc:PropertyName>
    </se:Label>
    <se:Font>
      <se:SvgParameter name="font-family">Times New Roman</se:SvgParameter>
      <se:SvgParameter name="font-size">10</se:SvgParameter>
    </se:Font>
    <se:LabelPlacement>
      <se:PointPlacement>
        <se:AnchorPoint>
          <se:AnchorPointX>0.5</se:AnchorPointX>
          <se:AnchorPointY>0.5</se:AnchorPointY>
        <se:Displacement>
            <se:DisplacementX>-25</se:DisplacementX>
            <se:DisplacementY>-25</se:DisplacementY>
        </se:Displacement>
        </se:AnchorPoint> 
      </se:PointPlacement>
    </se:LabelPlacement>
    <se:Halo>
      <se:Radius>1</se:Radius>
      <se:Fill>
        <se:SvgParameter name="fill">#ffffff</se:SvgParameter>
      </se:Fill>
    </se:Halo>
    <se:Fill>
      <se:SvgParameter name="fill">#ff0000</se:SvgParameter>
    </se:Fill>
  </se:TextSymbolizer>
</se:Rule>
1
  • Changing Displacement value doesn't change anything :/
    – jukuka
    Commented Aug 16, 2021 at 8:50

1 Answer 1

0

There may be something else wrong with your style as

       <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
              <AnchorPointX>0.5</AnchorPointX>
              <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
            <Displacement>
              <DisplacementX>-25</DisplacementX>
              <DisplacementY>-25</DisplacementY>
              </Displacement>
            
          </PointPlacement>
        </LabelPlacement>

works for me:

enter image description here

Your Answer

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

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