[Qgis-user] Problems saving layer style as SLD for use in Geoserver 2.5

Luigi Pirelli luipir at gmail.com
Mon Sep 14 03:31:52 PDT 2015


I remember geoserver support SLD 1.0 and QGIS 1.1... more info here:

http://qgis.boundlessgeo.com/static/docs/intro.html#styling-limitations

regards
Luigi Pirelli

**************************************************************************************************
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Elance: https://www.elance.com/s/edit/luigipirelli/
* GitHub: https://github.com/luipir
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* Mastering QGIS:
https://www.packtpub.com/application-development/mastering-qgis
**************************************************************************************************


On 11 September 2015 at 15:51, Chris Buckmaster
<chris.buckmaster at runnymede.gov.uk> wrote:
> Hi
>
>
>
> I am trying to style my layers in Geoserver with the SLD files I am creating
> through QGIS but am encountering some errors, for example when using
> diagonal lines for a polygon layer:-
>
>
>
> ·         Parsing failed for Filter: java.lang.RuntimeException: Unable to
> find function Literal
>
> ·         line 23: cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'ogc:Filter'. One of
> '{"http://www.opengis.net/ogc":expression}' is expected.
>
> ·         line 24: cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'ogc:Literal'. One of
> '{"http://www.opengis.net/ogc":spatialOps,
> "http://www.opengis.net/ogc":comparisonOps,
> "http://www.opengis.net/ogc":logicOps, "http://www.opengis.net/ogc":_Id}' is
> expected.
>
>
>
> I have read that there are some issues when trying to use SLD generated
> files from QGIS in Geoserver as they are not set in the correct standard? Is
> that right? Are there any plugins that might export the styles out for use
> in Geoserver? I don’t really want to have to write all my styles from
> scratch L
>
>
>
> My SLD is below:-
>
>
>
> <?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>air_quality_management_areas</se:Name>
>     <UserStyle>
>       <se:Name>air_quality_management_areas</se:Name>
>       <se:FeatureTypeStyle>
>         <se:Rule>
>           <se:Name>Single symbol</se:Name>
>           <se:PolygonSymbolizer>
>             <se:Fill>
>               <se:GraphicFill>
>                 <se:Graphic>
>                   <se:Mark>
>                     <se:WellKnownName>horline</se:WellKnownName>
>                     <se:Stroke>
>                       <se:SvgParameter
> name="stroke">#5c98e6</se:SvgParameter>
>                       <se:SvgParameter
> name="stroke-width">0.25</se:SvgParameter>
>                     </se:Stroke>
>                   </se:Mark>
>                   <se:Size>5</se:Size>
>                   <se:Rotation>
>                     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
>                       <ogc:Literal>45</ogc:Literal>
>                     </ogc:Filter>
>                   </se:Rotation>
>                 </se:Graphic>
>               </se:GraphicFill>
>             </se:Fill>
>           </se:PolygonSymbolizer>
>           <se:PolygonSymbolizer>
>             <se:Fill>
>               <se:GraphicFill>
>                 <se:Graphic>
>                   <se:Mark>
>                     <se:WellKnownName>horline</se:WellKnownName>
>                     <se:Stroke>
>                       <se:SvgParameter
> name="stroke">#5c98e6</se:SvgParameter>
>                       <se:SvgParameter
> name="stroke-width">0.25</se:SvgParameter>
>                     </se:Stroke>
>                   </se:Mark>
>                   <se:Size>5</se:Size>
>                   <se:Rotation>
>                     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
>                       <ogc:Literal>135</ogc:Literal>
>                     </ogc:Filter>
>                   </se:Rotation>
>                   <se:Displacement>
>                     <se:DisplacementX>0</se:DisplacementX>
>                     <se:DisplacementY>0</se:DisplacementY>
>                   </se:Displacement>
>                 </se:Graphic>
>               </se:GraphicFill>
>             </se:Fill>
>           </se:PolygonSymbolizer>
>           <se:LineSymbolizer>
>             <se:Stroke>
>               <se:SvgParameter name="stroke">#5c98e6</se:SvgParameter>
>               <se:SvgParameter name="stroke-width">0.5</se:SvgParameter>
>               <se:SvgParameter
> name="stroke-linejoin">bevel</se:SvgParameter>
>               <se:SvgParameter
> name="stroke-linecap">square</se:SvgParameter>
>             </se:Stroke>
>           </se:LineSymbolizer>
>         </se:Rule>
>       </se:FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
> </StyledLayerDescriptor>
>
>
>
>
>
> Thanks, Chris
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user



More information about the Qgis-user mailing list