The below sld passing attribute5 having 3.09 or 5.56. But not 1690.98 or 10923.34 which is just opposite of what we need. How to parse the string attribute5 data as number here..

  • The Filter specification shows something very similar to this in Example 14 (using ValueReference). Have you tried that? If so, what happened? If not, perhaps worth a try.
    – BradHards
    Commented Jan 29, 2014 at 7:28
  • Please give the link...
    – Kumar
    Commented Jan 29, 2014 at 7:29
  • Its the first hit for google for "OGC Filter" for me: opengeospatial.org/standards/filter
    – BradHards
    Commented Jan 29, 2014 at 7:33
  • 1
    You need to make attribute5 a double rather than a string. If attribute5 is a string it has to work this way
    – Ian Turton
    Commented Jan 29, 2014 at 7:37
  • 1
    @iant Thanks buddy. Please give this as answer, It works.
    – Kumar
    Commented Jan 29, 2014 at 7:53

1 Answer 1


Since you have set attribute5 as a String GeoServer will always use string comparisons if you want it to work as a number you will need to set attribute5 to double.

  • I replaced <ogc:PropertyName>attribute5</ogc:PropertyName> with <ogc:Function name="parseDouble"> <ogc:PropertyName>attribute5</ogc:PropertyName> </ogc:Function> to get a working code... Thanks @iant
    – Kumar
    Commented Jan 30, 2014 at 11:13

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.