0

I'm trying to label points with a rule based on two fields:

  1. Text
  2. kkod

I need to create a rule: "When the letter E is in Text field and kkod=79" then label with the Text field content.

So the first point should be labeled "E4" but not the second: enter image description here

This give "No validation errors." but makes all other labels not show. What is the problem?

<Rule>
 <Name>Europavag</Name>
 <ogc:Filter>
 <ogc:And>
  
   <ogc:PropertyIsEqualTo>
     <ogc:PropertyName>kkod</ogc:PropertyName>
     <ogc:Literal>79</ogc:Literal>
   </ogc:PropertyIsEqualTo>
  
  <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
    <ogc:PropertyName>kkod</ogc:PropertyName>
    <ogc:Literal>*E*</ogc:Literal>
   </ogc:PropertyIsLike>
  
  </ogc:And>
 </ogc:Filter>
 
  <PointSymbolizer>
    <Graphic>
      <Mark>
        <WellKnownName>square</WellKnownName>
        <Fill>
          <CssParameter name="fill">#0033cc</CssParameter>
          <CssParameter name="fill-opacity">0</CssParameter>
        </Fill>
      </Mark>
      <Size>1</Size>
    </Graphic>
  </PointSymbolizer>
  <TextSymbolizer>
  <Label>
    <ogc:PropertyName>text</ogc:PropertyName>
  </Label>
  <Font>
    <CssParameter name="font-family">Arial</CssParameter>
    <CssParameter name="font-size">16</CssParameter>
    <CssParameter name="font-style">normal</CssParameter>
    <CssParameter name="font-weight">bold</CssParameter>
  </Font>
    </PointPlacement>
  </LabelPlacement>
  <Fill>
    <CssParameter name="fill">#000000</CssParameter>
  </Fill>
</TextSymbolizer>
</Rule>

1 Answer 1

1

Your label will show when (and only when) kkod is 79 and kkod contains an E, so never. I'd make the 2nd property reference text.

0

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.