[mapserver-users] Mapserver consuming SLD coming from Udig and Styler (OpenGeo Suite)
Martin Ouellet
geomartino at gmail.com
Thu Nov 11 11:12:42 PST 2010
Hi all,
I'a, trying to use SLD files with Mapserver.
I've started from an example of this web site (
http://mapserver.org/ogc/sld.html) is working well but if I use a SLD
generated by Udig or the Styler (OpenGeo suite), it does not.
working SLD:
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.1.0"
xmlns="http://www.opengis.net/sld"
xmlns:se="http://www.opengis.net/se"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<se:Name>INDEX_20K</se:Name>
<UserStyle>
<se:Name>xxx</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:PolygonSymbolizer>
<se:Geometry>
<ogc:PropertyName>center-line</ogc:PropertyName>
</se:Geometry>
<se:Fill>
<sld:CssParameter name="fill">#008040</sld:CssParameter>
<sld:CssParameter name="fill-opacity">0.5</sld:CssParameter>
</se:Fill>
<se:Stroke>
<sld:CssParameter name="stroke">#008040</sld:CssParameter>
<sld:CssParameter name="stroke-width">2</sld:CssParameter>
</se:Stroke>
</se:PolygonSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
The one generated from the Styler raise an error (WMS server error. Invalid
SLD document)
<?xml version="1.0" encoding="UTF-8"?>
<sld:UserStyle xmlns="http://www.opengis.net/sld" xmlns:sld="
http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml">
<sld:Name>INDEX_20K</sld:Name>
<sld:Title>Default polygon style</sld:Title>
<sld:Abstract>A sample style</sld:Abstract>
<sld:FeatureTypeStyle>
<sld:Name>name</sld:Name>
<sld:Rule>
<sld:Name>default</sld:Name>
<sld:Title>Index20K</sld:Title>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name="fill">#008040</sld:CssParameter>
<sld:CssParameter name="fill-opacity">0.5</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name="stroke">#008040</sld:CssParameter>
<sld:CssParameter name="stroke-width">2</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
The one from Udig is simply ignored by mapserver (without raising any error)
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="
http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
<sld:UserLayer>
<sld:LayerFeatureConstraints>
<sld:FeatureTypeConstraint/>
</sld:LayerFeatureConstraints>
<sld:UserStyle>
<sld:Name>Default Styler</sld:Name>
<sld:Title/>
<sld:IsDefault>1</sld:IsDefault>
<sld:FeatureTypeStyle>
<sld:Name>simple</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
<sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
<sld:Rule>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter
name="fill">#008040</sld:CssParameter>
<sld:CssParameter
name="fill-opacity">0.5</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter
name="stroke">#008000</sld:CssParameter>
<sld:CssParameter
name="stroke-width">2</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:UserLayer>
</sld:StyledLayerDescriptor>
Is there any chance that you had similar issues?
thanks!
MartinO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101111/03b9a8e1/attachment.htm>
More information about the MapServer-users
mailing list