<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19046"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011>if i take your sld file and modify it for my datset, i
have no problem to apply it as SLD or SLD_BODY to the wms layer. Using
OpenLayers 2.10 and MapServer.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011>So it seems it's not a bug with
OpenLayers.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=530370420-08062011>online example</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><A
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/MapServer_SLD_World/MapServer_SLD_World.asp?SLDsrcIdx=56">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/MapServer_SLD_World/MapServer_SLD_World.asp?SLDsrcIdx=56</A></FONT></DIV>
<DIV> </DIV><U><FONT color=#810081 size=2 face=Arial></FONT></U>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT><FONT color=#0000ff size=2
face=Arial></FONT><BR><SPAN class=530370420-08062011><FONT color=#0000ff size=2
face=Arial>Arnd</FONT></SPAN></DIV>
<DIV><SPAN class=530370420-08062011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von
</B>IvanBell<BR><B>Gesendet:</B> Mittwoch, 8. Juni 2011 14:58<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] OpenLayers SLD
Bug?<BR></FONT><BR></DIV>
<DIV></DIV>
<P>I am having difficulty troubleshooting an OpenLayers issue I have had for
several weeks now. The issue concerns coloring polygons in a layer using
multiple SLD styles filtered by the polygons' feature id.</P>
<P>I had a variation of the issue posted in <A
href="http://osgeo-org.1803224.n2.nabble.com/WMS-polygon-fill-color-td6374589.html"
rel=nofollow target=_top link="external">this forum</A> a few weeks ago, when I
was trying to figure out SLD and before I even knew there was an OpenLayers
issue with SLD.</P>
<P>I also posted an <A
href="http://osgeo-org.1803224.n2.nabble.com/Multiple-SLD-Rules-for-PolygonSymbolizer-on-a-Single-Layer-td6378253.html"
rel=nofollow target=_top link="external">SLD syntax issue</A> to the GeoServer
forum.</P>
<P>On Monday, I was able to eliminate GeoServer as the problem.</P>
<P>The OpenLayers problems I am having are detailed in the <A
href="http://osgeo-org.1803224.n2.nabble.com/Multiple-SLD-Rules-for-PolygonSymbolizer-on-a-Single-Layer-td6378253.html#a6432838"
rel=nofollow target=_top link="external">06/02 post to the SLD syntax issue</A>
in the GeoServer forum.</P>
<P>Basically, within GeoServer, if I configure/apply the following default SLD
style for the layer:</P><PRE><BLOCKQUOTE>
<sld:StyledLayerDescriptor
xmlns:sld=\"http://www.opengis.net/sld\"
version=\"1.0.0\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd\"
xmlns:ogc=\"http://www.opengis.net/ogc\"
xmlns:gml=\"http://www.opengis.net/gml\">
<sld:NamedLayer>
<sld:Name>LaPalma:Polygon_Layer_Room</sld:Name>
<sld:UserStyle>
<sld:FeatureTypeStyle>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.1\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.2\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.3\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.4\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.5\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.6\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.7\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.8\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.9\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.10\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#0000FF</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#000080</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.11\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.12\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.13\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.14\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.15\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.16\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.17\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#FF0000</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#800000</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.18\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.19\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.20\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#00FF00</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#008000</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.21\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.22\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.23\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.24\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.25\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#FFFF00</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#808000</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.26\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.27\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.28\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.29\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.30\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.31\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.32\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.33\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#FF007F</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#C71585</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.34\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.35\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.36\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#FFC0CB</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#FF3E96</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.37\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.38\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.39\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.40\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.41\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#800080</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#68228B</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<ogc:Filter>
<ogc:FeatureId fid=\"Polygon_Layer_Room.42\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.43\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.44\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.45\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.46\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.47\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.48\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.49\"/>
<ogc:FeatureId fid=\"Polygon_Layer_Room.50\"/>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#C00000</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#FF1CAE</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:ElseFilter/>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name=\"fill\">#00FFFF</sld:CssParameter>
<sld:CssParameter name=\"fill-opacity\">0.8</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name=\"stroke\">#0000FF</sld:CssParameter>
<sld:CssParameter name=\"stroke-opacity\">1</sld:CssParameter>
<sld:CssParameter name=\"stroke-width\">1</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>
</BLOCKQUOTE>
</PRE>
<P>then the map is correctly rendered with the various colors/styles for the
named polygons (by feature id) in that layer. This also includes the "rest" of
the polygons defined by the <ElseFilter/> style, the use of which I was
having issues combining with the fid filters.</P>
<P>If, however, I try any variation of applying this SLD using OpenLayers, I get
the errors described in the <A
href="http://osgeo-org.1803224.n2.nabble.com/Multiple-SLD-Rules-for-PolygonSymbolizer-on-a-Single-Layer-td6378253.html#a6432838"
rel=nofollow target=_top link="external">6/2 post</A>.</P>
<P>Can anyone please tell me how to apply the above SLD style (or anything
similar) using OpenLayers, or is there an OpenLayers SLD bug?</P>
<P>Even if you don't have a solution, any suggestions that might point me to one
would be appreciated.</P>
<P>Sincerely,<BR>Ivan Bell</P>
<DIV class=signature>Up the Irons!!!</DIV><BR>
<HR align=left width=300>
View this message in context: <A
href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-SLD-Bug-tp6453498p6453498.html">OpenLayers
SLD Bug?</A><BR>Sent from the <A
href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers
Users mailing list archive</A> at Nabble.com.<BR></BODY></HTML>