[Mapserver-users] SLD Problems

Stefan Schwarzer stefan.schwarzer at grid.unep.ch
Fri Mar 5 01:28:53 PST 2004


--=====================_96063968==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi there,

I am trying to change the layer properties via SLD. Although I think I 
setup everything correctly, it just doesn't want to work. Could anyone 
perhaps give me a hint on what I do wrong? See below the URL, the SLD and 
the MAP file. The map displays, but not with the desired changes in fill 
and stroke.

Thanks for any help,

Stefan


http://localhost/cgi-bin/mapserv_41.exe?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&map=E:/inetpub/wwwroot/wms_maps/wms.map&layers=boundaries&SLD=http//localhost/wms_maps/sld.xml



<StyledLayerDescriptor version="1.0.0">
         <NamedLayer>
                 <Name>boundaries</Name>
                 <UserStyle>
                         <Title>xxx</Title>
                         <FeatureTypeStyle>
                                 <Rule>
                                         <PolygonSymbolizer>
                                                 <Fill>
                                                         <CssParameter 
name="fill">#0000ff</CssParameter>
                                                 </Fill>
                                                 <Stroke>
                                                         <CssParameter 
name="stroke">#ff0000</CssParameter>
                                                 </Stroke>
                                         </PolygonSymbolizer>
                                 </Rule>
                         </FeatureTypeStyle>
                 </UserStyle>
         </NamedLayer>
</StyledLayerDescriptor>



#
# Start of map file
#

NAME boundaries
         STATUS ON
         SIZE 600 300
         EXTENT -180 -90 180 90
         UNITS DD
         SHAPEPATH "data"
         IMAGETYPE PNG
         FONTSET etc/fonts.txt



         # Projection definition ---------------------

         PROJECTION
                 "init=epsg:4326"
                 proj=latlong
                 ellps=WGS84
         END

         # End Projection definition ---------------------



         # Web definition ---------------------

         WEB
                 HEADER demo_header.html
                 TEMPLATE demo.html
                 FOOTER demo_footer.html

                 IMAGEPATH '../temp/'
                 IMAGEURL 'temp/'

                 METADATA
                         "wms_title" "boundaries"
                         "wms_onlineresource" 
"http://my_server/cgi-bin/mapserv_41.exe?map=E:/inetpub/wwwroot/wms_maps/wms.map?"
                 END
         END

         # End Web definition ---------------------



         LAYER
                 NAME boundaries
                 TYPE POLYGON
                 STATUS ON
                 DATA boundaries
                 DUMP TRUE
                 CLASSITEM CNTRY_NAME
                 CLASS
                         NAME 'boundaries'
                         OUTLINECOLOR 0 0 0
                         COLOR 100 100 100
                         TEMPLATE 'dummy'
                 END
                 METADATA
                         wms_title "boundaries"
                 END
         END

END # Map File




         _______________________________________

         Stefan Schwarzer
         Consultant on GEO

         UNEP/DEWA/GRID-Geneva
         Chemin des Anemones 11
         CH - 1219 Chatelaine
         Switzerland

         Tel: (+41) 22.917.83.49
         Fax: (+41) 22.917.80.29

         Email: stefan.schwarzer at grid.unep.ch
         Internet: http://geodata.grid.unep.ch/
         _______________________________________ 
--=====================_96063968==.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<body>
Hi there,<br><br>
I am trying to change the layer properties via SLD. Although I think I
setup everything correctly, it just doesn't want to work. Could anyone
perhaps give me a hint on what I do wrong? See below the URL, the SLD and
the MAP file. The map displays, but not with the desired changes in fill
and stroke.<br><br>
Thanks for any help,<br><br>
Stefan<br><br>
<br>
<a href="http://localhost/cgi-bin/mapserv_41.exe?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&map=E:/inetpub/wwwroot/wms_maps/wms.map&layers=boundaries&SLD=http//localhost/wms_maps/sld.xml" eudora="autourl">http://localhost/cgi-bin/mapserv_41.exe?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&map=E:/inetpub/wwwroot/wms_maps/wms.map&layers=boundaries&SLD=http//localhost/wms_maps/sld.xml</a><br><br>
<br><br>
<font color="#FF0000"><StyledLayerDescriptor
version="1.0.0"><br>
<x-tab>        </x-tab><NamedLayer><br>
<x-tab>        </x-tab><x-tab>        </x-tab><Name>boundaries</Name><br>
<x-tab>        </x-tab><x-tab>        </x-tab><UserStyle><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><Title>xxx</Title><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><FeatureTypeStyle><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><Rule><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><PolygonSymbolizer><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><Fill><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><CssParameter
name="fill">#0000ff</CssParameter><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab></Fill><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><Stroke><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><CssParameter
name="stroke">#ff0000</CssParameter><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab></Stroke><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab></PolygonSymbolizer><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab></Rule><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab></FeatureTypeStyle><br>
<x-tab>        </x-tab><x-tab>        </x-tab></UserStyle><br>
<x-tab>        </x-tab></NamedLayer><br>
</StyledLayerDescriptor><br><br>
<br><br>
#<br>
# Start of map file<br>
#<br><br>
NAME boundaries<br>
<x-tab>        </x-tab>STATUS
ON<br>
<x-tab>        </x-tab>SIZE 600
300<br>
<x-tab>        </x-tab>EXTENT
-180 -90 180 90<br>
<x-tab>        </x-tab>UNITS
DD<br>
<x-tab>        </x-tab>SHAPEPATH
"data"<br>
<x-tab>        </x-tab>IMAGETYPE
PNG<br>
<x-tab>        </x-tab>FONTSET
etc/fonts.txt<br><br>
<br><br>
<x-tab>        </x-tab>#
Projection definition ---------------------<br><br>
<x-tab>        </x-tab>PROJECTION<br>
<x-tab>        </x-tab><x-tab>        </x-tab>"init=epsg:4326"<br>
<x-tab>        </x-tab><x-tab>        </x-tab>proj=latlong<br>
<x-tab>        </x-tab><x-tab>        </x-tab>ellps=WGS84<br>
<x-tab>        </x-tab>END<br>
<x-tab>        </x-tab><br>
<x-tab>        </x-tab># End
Projection definition ---------------------<br>
<x-tab>        </x-tab><br><br>
<br>
<x-tab>        </x-tab># Web
definition ---------------------<br>
<x-tab>        </x-tab><br>
<x-tab>        </x-tab>WEB<br>
<x-tab>        </x-tab><x-tab>        </x-tab>HEADER
demo_header.html<br>
<x-tab>        </x-tab><x-tab>        </x-tab>TEMPLATE
demo.html<br>
<x-tab>        </x-tab><x-tab>        </x-tab>FOOTER
demo_footer.html<br>
<x-tab>        </x-tab><x-tab>        </x-tab><br>
<x-tab>        </x-tab><x-tab>        </x-tab>IMAGEPATH
'../temp/'<br>
<x-tab>        </x-tab><x-tab>        </x-tab>IMAGEURL
'temp/'<br><br>
<x-tab>        </x-tab><x-tab>        </x-tab>METADATA<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>"wms_title"
"boundaries"<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>"wms_onlineresource" 
"<a href="http://my_server/cgi-bin/mapserv_41.exe?map=E:/inetpub/wwwroot/wms_maps/wms.map" eudora="autourl">http://my_server/cgi-bin/mapserv_41.exe?map=E:/inetpub/wwwroot/wms_maps/wms.map</a>?"<br>
<x-tab>        </x-tab><x-tab>        </x-tab>END<br>
<x-tab>        </x-tab>END<br>
<x-tab>        </x-tab><br>
<x-tab>        </x-tab># End Web
definition ---------------------<br><br>
<br>
<x-tab>        </x-tab><br>
<x-tab>        </x-tab>LAYER<br>
<x-tab>        </x-tab><x-tab>        </x-tab>NAME
boundaries<br>
<x-tab>        </x-tab><x-tab>        </x-tab>TYPE
POLYGON<br>
<x-tab>        </x-tab><x-tab>        </x-tab>STATUS
ON<br>
<x-tab>        </x-tab><x-tab>        </x-tab>DATA
boundaries<br>
<x-tab>        </x-tab><x-tab>        </x-tab>DUMP
TRUE<br>
<x-tab>        </x-tab><x-tab>        </x-tab>CLASSITEM
CNTRY_NAME<br>
<x-tab>        </x-tab><x-tab>        </x-tab>CLASS
<x-tab>  </x-tab><br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>NAME
'boundaries'<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>OUTLINECOLOR
0 0 0<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>COLOR
100 100 100<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>TEMPLATE
'dummy'<br>
<x-tab>        </x-tab><x-tab>        </x-tab>END<br>
<x-tab>        </x-tab><x-tab>        </x-tab>METADATA<br>
<x-tab>        </x-tab><x-tab>        </x-tab><x-tab>        </x-tab>wms_title
"boundaries"<br>
<x-tab>        </x-tab><x-tab>        </x-tab>END<br>
<x-tab>        </x-tab>END<br><br>
END # Map File<br><br>
<br><br>
</font><x-sigsep><p></x-sigsep>
<font size=3><x-tab>        </x-tab>_______________________________________<br><br>
</font><font size=2><x-tab>        </x-tab><b>Stefan
Schwarzer<br>
</b><x-tab>        </x-tab>Consultant
on GEO<br><br>
<x-tab>        </x-tab>UNEP/DEWA/GRID-Geneva<br>
<x-tab>        </x-tab>Chemin des
Anemones 11<br>
<x-tab>        </x-tab>CH - 1219
Chatelaine<br>
<x-tab>        </x-tab>Switzerland<br><br>
<x-tab>        </x-tab>Tel: (+41)
22.917.83.49<br>
<x-tab>        </x-tab>Fax: (+41)
22.917.80.29<br><br>
<x-tab>        </x-tab>Email:
stefan.schwarzer at grid.unep.ch<br>
<x-tab>        </x-tab>Internet:
<a href="http://geodata.grid.unep.ch/" eudora="autourl">http://geodata.grid.unep.ch/<br>
</a></font><font size=3><x-tab>        </x-tab>_______________________________________</font></body>
</html>

--=====================_96063968==.ALT--




More information about the MapServer-users mailing list