0

I want to render my points using the point stacker transformation. I am creating a style so that when zoomed in far enough the individual points are in 4 different categories using 4 different colors. To do this I'm trying to use 4 different rules and in each rule I try to filter the points based on two things. The first where 'count' Is Equal To '1' where the attribute count has been generated by the point stacker. Second where 'Attribute' Is Equal To 'Attribute value' which is already stored in the data and consists from string values.

My problem is that when I am trying to to filter the points using 'ogc:And' my output is empty.

My code using the filters is:

    <Rule>
      <Name>rule1</Name>
      <Title>MyTitle</Title>
      <ogc:Filter>
       <ogc:And>
        <ogc:PropertyIsLessThanOrEqualTo>
          <ogc:PropertyName>count</ogc:PropertyName>
         <ogc:Literal>1</ogc:Literal>
        </ogc:PropertyIsLessThanOrEqualTo>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>AttributeColumn</ogc:PropertyName>
         <ogc:Literal>MyValue</ogc:Literal>
        </ogc:PropertyIsEqualTo>
       <ogc:And>
      </ogc:Filter>
      <PointSymbolizer>
        <Graphic>
          <Mark>
            <WellKnownName>circle</WellKnownName>
            <Fill>
              <CssParameter name="fill">#FF0000</CssParameter>
            </Fill>
          </Mark>
          <Size>8</Size>
        </Graphic>
      </PointSymbolizer>
    </Rule>
    <Rule>

When I am using the ogc:And statement the output of this rule is empty. When I use ogc:Or there is an output, which makes sense. However I can only use a rule with ogc:Or once because it is always true and geoserver ends up displaying all points in the same color regardless of the other rules set. So I need to use ogc:And. I am very new to geoserver and sld and I do not understand why my statement is giving me an empty output. When I validate my statement it gives me no errors and the rest of the code works fine.

After these 4 rules I have 2 more rules that define the clustering of the points, I basically copied that part from the OpenGeoSuite website and it works fine.

geoserver version is 2.8.2

Any thoughts why I get an empty output or perhaps a workaround this problem?

2
  • I would try PropertyIsLike with the string attribute even PropertyIsEqualTo should work as well.
    – user30184
    Commented May 8, 2017 at 21:15
  • 2
    it's hard to answer this without seeing some of the data
    – Ian Turton
    Commented May 9, 2017 at 7:55

1 Answer 1

1

Try </ogc:And> to close <ogc:And>.

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.