[MapServer-users] SLD with both - 45 degree diagonal hatch and background color

Karsten Vennemann karsten at terragis.net
Sun Feb 16 17:35:30 PST 2025


Hi All,

I have been working on creating a correct SLD (that I can use as the 
|SLD| parameter, referencing it as a file) in a WMS request.
However, I’m struggling to get the desired outcome.

I came up with the SLD below but still have these issues to solve:

  * The SLD kind of works, but I get a checkered hatch instead of a
    simple 45° hatch.
  * Increasing the |stroke-width| to higher values has no effect on
    making the hatch thicker.

Any ideas on how to fix this?

Cheers,
Karsten Vennemann

*Terra GIS LTD
*
---------------
sample request:
http://declare.terragis.net/cgi-bin/mapserv?map=/var/mapdata/declare/benin_server.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=countries&SLD_VERSION=1.1.0&FEATURE_COUNT=1&WIDTH=1920&HEIGHT=1253&CRS=EPSG%3A3857&BBOX=-173424.68570267071%2C745560.5997697945%2C653569.1115583682%2C1285260.1976698372&SLD=http://declare.terragis.net/tmp/counties3.sld*
------------------*

<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" 
xsi:schemaLocation="http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
   <NamedLayer>
     <Name>countries</Name>
     <UserStyle>
       <Title>countries</Title>
       <FeatureTypeStyle>
         <Rule>
           <Name/>
           <Title/>
           <se:PolygonSymbolizer>
             <se:Fill>
               <se:SvgParameter name="fill">#f4da9c</se:SvgParameter>
             </se:Fill>
           </se:PolygonSymbolizer>
         <se:PolygonSymbolizer>
         <Fill>
             <GraphicFill>
                 <Graphic>
                     <Mark>
<WellKnownName>slash</WellKnownName>
                         <Stroke>
                             <CssParameter 
name="stroke">#3d8d95</CssParameter>  <!-- stripes -->
                             <CssParameter 
name="stroke-width">8</CssParameter>  <!-- width -->
                         </Stroke>
                     </Mark>
                     <Size>18</Size>
                 </Graphic>
             </GraphicFill>
         </Fill>
         </se:PolygonSymbolizer>
         </Rule>
       </FeatureTypeStyle>
     </UserStyle>
   </NamedLayer>
</StyledLayerDescriptor>*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20250216/23e5a69c/attachment.htm>


More information about the MapServer-users mailing list