Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have two SLD rules one using PropertyIsEqualTo and another using PropertyIsLike

Using PropertyIsEqualTo

<Rule>
          <Name>Vendor FirstVendor</Name>
          <Title>FristVendor</Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
            <ogc:PropertyName>Vendor</ogc:PropertyName>
            <ogc:Literal>firstVendor</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#0033CC</CssParameter>
                </Fill>
              </Mark>
              <Size>8</Size>
            </Graphic>
          </PointSymbolizer>              
     </Rule>

Using PropertyIsLike

<ogc:Filter>
            <ogc:PropertyIsLike  wildCard="*" singleChar="." escape="!">
            <ogc:PropertyName>Vendor</ogc:PropertyName>
            <ogc:Literal>firstVendor*</ogc:Literal>
            </ogc:PropertyIsLike>
</ogc:Filter>

The SLD using Like works fine where as using equal does not work at all.I have seen the string in database well there is not leading or trailing spaces.

share|improve this question
    
Did you manage to find a solution to your problem. I seem to be having the exact same issue using PropertyIsEqualTo. I have looked at the resulting query that Geoserver creates and run this on the database. The database returns the results as expected but geoserver does not seem to render anything for the layer. Any help is much appreciated. Apologies for not posting this as a comment but it won't allow me to as I just created an account. –  k9ty Nov 23 '12 at 14:30
    
@k9ty yes I found the solution the problem is there is some kind of bug or I don't know what's it the sld won't work you should use <ogc:Filter> <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!"> <ogc:PropertyName>Vendor</ogc:PropertyName> <ogc:Literal>V1*</ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter> –  kinkajou Nov 26 '12 at 3:55
    
@k9ty here we have used the query "like" it the solution for now I guess. I could not solbe the problem with captDragon solution as there was validation error. –  kinkajou Nov 26 '12 at 3:56
add comment

1 Answer

Try adding matchCase="true" like this:

<ogc:PropertyIsEqualTo matchCase="true">
    <ogc:PropertyName>Vendor</ogc:PropertyName>
    <ogc:Literal>firstVendor</ogc:Literal>
</ogc:PropertyIsEqualTo>

I know it doesn't really make sense, but comparing yours to mine, that's the only difference i see.

share|improve this answer
    
Attribute 'matchCase' is not allowed to appear in element 'ogc:PropertyIsEqualTo' –  kinkajou Feb 29 '12 at 3:59
    
What is not allowing you? It's part of the OGC spec. –  CaptDragon Feb 29 '12 at 13:40
    
it works partially but geoserver validate button generates error –  kinkajou Mar 1 '12 at 4:58
    
What's the error? And do you have this xmlns:ogc="http://www.opengis.net/ogc" at the top of the xml file? –  CaptDragon Mar 1 '12 at 13:54
    
Yes. xsi:schemaLocation="opengis.net/sld StyledLayerDescriptor.xsd" xmlns="opengis.net/sld"; xmlns:ogc="opengis.net/ogc"; xmlns:xlink="w3.org/1999/xlink"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; –  kinkajou Mar 5 '12 at 4:40
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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