SLD Question

Jeremy Wiebe Jwiebe at LINNET.CA
Thu Aug 5 11:11:24 EDT 2004


Our application uses SLD successfully.   Here's an example mapserver query
using SLD:

http://realestate/scripts/mapserv.exe?version=1.1.0&map=d:\website\mapsample
s\wms_server\map\realestate.linnet.com\wms.map&request=getmap&srs=epsg:26914
&bbox=633777,5514480,641839,5522542&layers=regions,majorroads,hydrography,ne
ighborhoods,churches,schools,cadastral,roads,property&SLD=http://realestate/
SldFiles/dfc0c904-b0c7-49e2-9ff5-26108199a7f9.xml&WIDTH=350&HEIGHT=350

Below is the example SLD also:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" 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"
xsi:schemaLocation="http://www.opengis.net/sld&#xD;&#xA;
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>property</Name>
    <UserStyle>
      <Title>PropertyFilter</Title>
      <FeatureTypeStyle>
        <Rule>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>PROPERTY_ID</ogc:PropertyName>
              <ogc:Literal>101063</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <PointSymbolizer>
            <Geometry>
              <ogc:PropertyName>locatedAt</ogc:PropertyName>
            </Geometry>
            <Graphic>
              <Mark>
                <WellKnownName>star</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#00ff00</CssParameter>
                </Fill>
              </Mark>
              <Size>8.0</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <ElseFilter />
          <PointSymbolizer>
            <Geometry>
              <ogc:PropertyName>locatedAt</ogc:PropertyName>
            </Geometry>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#ff8484</CssParameter>
                </Fill>
              </Mark>
              <Size>5.0</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

And yes, you should be able to see the mapserv.exe fetching the xml file
from the web server.   One other thing to test would be to send the actual
SLD to the mapserv.exe using the SLD_BODY CGI variable as opposed to using
the SLD CGI variable.

Hope that helps,

Jeremy Wiebe
Application Developer



-----Original Message-----
From: Alexandre Florio [mailto:aflorio at GISPLAN.COM.BR]
Sent: August 5, 2004 9:57 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] SLD Question


Hi,

    I can't get SLD to work.  What are the requirements?
    Isn't it enough to have Mapserver compiled with support to WMS?  Do I
have to put some
metadata information in the .map file?
    This is the request I'm using to test:

http://localhost/cgi-bin/mapserv?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LA
YERS=uf&SLD=http://localhost/prototipo-gis/test.xml&map=prototipo-gis/protot
ipo-gis-wms.map

    I should be able to see, in the webserver's logs, Mapserver trying to
fetch the file "test.xml", right?  Nothing shows up there, except the
request above...

    I'm using latest Mapserver version 4.2.2.

Thanks in advance
Alexandre



More information about the mapserver-users mailing list