Trouble getting SLD working

Rod Suddaby rsuddaby at NRCAN.GC.CA
Thu Apr 28 15:00:44 EDT 2005


Hi List:
I'm a newbie to SLD and I've been trying to figure out why my build of
mapserver will not apply the styles. I've created the following SLD xml
file:

[test_sld.xml]
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld"
xmlns:gml="http://www.opengis.net/gml" 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.opengeospatial.net/sld/1.0.0/StyledLayerDescriptor.xsd">
 <NamedLayer>
   <Name>provinces</Name>
     <UserStyle>
       <Name>myStyle</Name>
         <FeatureTypeStyle>
           <Rule>
             <PolygonSymbolizer>
                <Fill>
                  <CssParameter name="fill">#00ff00</CssParameter>
                </Fill>
                <Stroke>
                  <CssParameter name="stroke">#0000ff</CssParameter>
                  <CssParameter name="stroke-width">3</CssParameter>
                </Stroke>
              </PolygonSymbolizer>
           </Rule>
        </FeatureTypeStyle>
     </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

The layer block of my mapfile is:

LAYER
  NAME provinces
  DATA prov_prj
  PROJECTION
    "init=epsg:42304"
  END
  UNITS METERS
  TYPE POLYGON
  STATUS ON

# CLASS
#   COLOR 255 0 0
#   OUTLINECOLOR 0 0 255
# END

END


I've sent the following request to the mapserver:
http://localhost/cgi-bin/mapserv?map=prov.map&version=1.1.
1&request=getMap&layers=provinces&styles=&sld=http://localhost/test_sld.xml

... and all I get is a blank image. Checking the apache access_log shows no
hit for the 'test_sld.xml' file. It seems that mapserver is simply ignoring
the sld parameter.
I've also tried putting the "wms_sld_url" tag in the layer metadata, tried
the "wms_sld_body" tag, and tried feeding the xml directly using the
sld_body parameter -- same result

Heres the output of mapserv -v:

%dragon>./mapserv -v
MapServer version 4.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBNP
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

O.S. Is Suse Linux 9.1

Can anyone see if I'm missing something here?
Also, are there any other resources available regarding SLD other than the
spec and the HOWTO docs?

Thanks,
Rod.



More information about the mapserver-users mailing list