0

I have grid, every part of grid have label with date. What I want is to put labels at polygon top. I tried to use displacement, but I have specific situation when parts of two polygons are visible.

Part of my current SLD style

<Rule>
      <MaxScaleDenominator>5001</MaxScaleDenominator>
      <TextSymbolizer>
        <Label>
          <ogc:PropertyName>date</ogc:PropertyName>
        </Label>
        <Font>
          <CssParameter name="font-family">Dialog.bold</CssParameter>
          <CssParameter name="font-weight">Bold</CssParameter>
          <CssParameter name="font-size">10</CssParameter>
        </Font>
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
              <AnchorPointX>0.5</AnchorPointX>
              <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
            <Displacement>
              <DisplacementX>0</DisplacementX>
              <DisplacementY>250</DisplacementY>
            </Displacement>
          </PointPlacement>
        </LabelPlacement>
        <Halo>
          <Radius>
            <ogc:Literal>1.2</ogc:Literal>
          </Radius>
          <Fill>
            <CssParameter name="fill">#666666</CssParameter>
          </Fill>
        </Halo>
        <Fill>
          <CssParameter name="fill">#ffffff</CssParameter>
        </Fill>
      </TextSymbolizer>
    </Rule>

This work fine if only one polygon is visible.

enter image description here

Specific situation when parts of two polygons are visible, no labels are visible.

enter image description here

I want to place the label at the highest point of the part of the polygon shown.

This is how it would look perfect:

enter image description here

Is it possible?

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.