Dear list,
sorry for cross-posting (see also: http://tinyurl.com/nwxvew6) but I am stuck. I am trying to style negative values in Geoserver via SLD and would like to know how the syntax in SLD should look like to do this. What I have is the following:
---snip---
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>trnsfrm_meta_outputmap</se:Name>
<UserStyle>
<se:Name>trnsfrm_meta_outputmap</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>-0.8290 - -0.4632</se:Name>
<se:Description>
<se:Title>-0.8290 - -0.4632</se:Title>
</se:Description>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:And>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>percentage_change</ogc:PropertyName>
<ogc:Literal>-<ogc:Literal>0.828977</ogc:Literal>
</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:PropertyName>percentage_change</ogc:PropertyName>
<ogc:Literal>-<ogc:Literal>0.463182</ogc:Literal>
</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
</ogc:And>
</ogc:Filter>
<se:PolygonSymbolizer>
<se:Fill>
<se:SvgParameter name="fill">#0000ff</se:SvgParameter>
</se:Fill>
<se:Stroke>
<se:SvgParameter name="stroke">#000000</se:SvgParameter>
<se:SvgParameter name="stroke-width">0.26</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
</se:Stroke>
</se:PolygonSymbolizer>
</se:Rule>
---snip---
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>trnsfrm_meta_outputmap</se:Name>
<UserStyle>
<se:Name>trnsfrm_meta_outputmap</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>-0.8290 - -0.4632</se:Name>
<se:Description>
<se:Title>-0.8290 - -0.4632</se:Title>
</se:Description>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:And>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>percentage_change</ogc:PropertyName>
<ogc:Literal>-<ogc:Literal>0.828977</ogc:Literal>
</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:PropertyName>percentage_change</ogc:PropertyName>
<ogc:Literal>-<ogc:Literal>0.463182</ogc:Literal>
</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
</ogc:And>
</ogc:Filter>
<se:PolygonSymbolizer>
<se:Fill>
<se:SvgParameter name="fill">#0000ff</se:SvgParameter>
</se:Fill>
<se:Stroke>
<se:SvgParameter name="stroke">#000000</se:SvgParameter>
<se:SvgParameter name="stroke-width">0.26</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
</se:Stroke>
</se:PolygonSymbolizer>
</se:Rule>
---snip---
But this throws an error in Geoserver:
Caused by: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: "-"
Position: 406
I already tried to change the SLD from this<ogc:Literal>-<ogc:Literal>0.828977</ogc:Literal></ogc:Literal>to this:<ogc:Literal>-0.828977</ogc:Literal>But this doesn't work either (Geoserver tells me that my SLD is not valid). I also reduced the number of rows in the PostGIS table to one and tried positive and negative values for the respective field, the error is always the same so I suspect a problem with the SLD.So my question is: What is the correct way of styling negative values in SLD? Or do I have to look for something else that I have not thougt of so far?Thanks in advance an best regardsJan
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users