[Mapserver-users] SLD Problems

Stefan Schwarzer stefan.schwarzer at grid.unep.ch
Fri Mar 5 04:47:47 PST 2004


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

Bart,

thanks for the script. Don't see so much difference though to mine. Could 
you perhaps send as well the map file, or at least the necessary parts, so 
that I can compare that as well? The uppercase didn't succeed...

And what's the Studio? Haven't heard about it and haven't seen it either on 
their web site.

Thanks for your help,

Stefan



>Hi Stefan,
>
>below is an SLD document which works for me on Mapserver. I have just 
>created this SLD with a test version of Studio, the new product by DM 
>Solutions for creating SLD documents.
>
>Note that the NAME is all uppercase in my generated SLD, I don't know why 
>this is the case, because it is not according to spec as far as I know. 
>You could try changing that in your SLD. Also, is your Mapserver binary 
>new enough for this stuff?
>
>Best regards,
>Bart
>
><StyledLayerDescriptor version="1.0.0">
><NamedLayer>
><NAME>Gemeentes</NAME>
><UserStyle>
><FeatureTypeStyle>
><Rule>
><Filter><PropertyIsEqualTo><PropertyName>GEMNAAM</PropertyName><Literal>Deurne</Literal></PropertyIsEqualTo></Filter>
><PolygonSymbolizer>
><Fill>
><CssParameter name="fill">#8f0000</CssParameter>
><GraphicFill>
><Graphic>
><Size>1</Size>
><Mark>
><WellKnownName>cross</WellKnownName>
><Fill>
><CssParameter name="fill">#8f0000</CssParameter>
></Fill>
></Mark>
></Graphic>
></GraphicFill>
></Fill>
></PolygonSymbolizer>
></Rule>
></FeatureTypeStyle>
></UserStyle>
></NamedLayer>
></StyledLayerDescriptor>
>
>Best regards,
>Bart
>
>On Fri, 05 Mar 2004 10:28:53 +0100, Stefan Schwarzer 
><stefan.schwarzer at grid.unep.ch> wrote:
>
>>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/
>>          _______________________________________
>
>
>
>--
>

         _______________________________________

         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/
         _______________________________________ 
--=====================_107998234==.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<body>
<font size=3>Bart,<br><br>
thanks for the script. Don't see so much difference though to mine. Could
you perhaps send as well the map file, or at least the necessary parts,
so that I can compare that as well? The uppercase didn't
succeed...<br><br>
And what's the Studio? Haven't heard about it and haven't seen it either
on their web site.<br><br>
Thanks for your help,<br><br>
Stefan<br><br>
<br><br>
<blockquote type=cite class=cite cite>Hi Stefan,<br><br>
below is an SLD document which works for me on Mapserver. I have just
created this SLD with a test version of Studio, the new product by DM
Solutions for creating SLD documents.<br><br>
Note that the NAME is all uppercase in my generated SLD, I don't know why
this is the case, because it is not according to spec as far as I know.
You could try changing that in your SLD. Also, is your Mapserver binary
new enough for this stuff?<br><br>
Best regards,<br>
Bart<br><br>
<StyledLayerDescriptor version="1.0.0"><br>
<NamedLayer><br>
<NAME>Gemeentes</NAME><br>
<UserStyle><br>
<FeatureTypeStyle><br>
<Rule><br>
<Filter><PropertyIsEqualTo><PropertyName>GEMNAAM</PropertyName><Literal>Deurne</Literal></PropertyIsEqualTo></Filter><br>
<PolygonSymbolizer><br>
<Fill><br>
<CssParameter
name="fill">#8f0000</CssParameter><br>
<GraphicFill><br>
<Graphic><br>
<Size>1</Size><br>
<Mark><br>
<WellKnownName>cross</WellKnownName><br>
<Fill><br>
<CssParameter
name="fill">#8f0000</CssParameter><br>
</Fill><br>
</Mark><br>
</Graphic><br>
</GraphicFill><br>
</Fill><br>
</PolygonSymbolizer><br>
</Rule><br>
</FeatureTypeStyle><br>
</UserStyle><br>
</NamedLayer><br>
</StyledLayerDescriptor><br><br>
Best regards,<br>
Bart<br><br>
On Fri, 05 Mar 2004 10:28:53 +0100, Stefan Schwarzer
<stefan.schwarzer at grid.unep.ch> wrote:<br><br>
<blockquote type=cite class=cite cite>Hi there,<br><br>
I am trying to change the layer properties via SLD. Although I think
I<br>
setup everything correctly, it just doesn't want to work. Could
anyone<br>
perhaps give me a hint on what I do wrong? See below the URL, the SLD
and<br>
the MAP file. The map displays, but not with the desired changes in
fill<br>
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>
<StyledLayerDescriptor version="1.0.0"><br>
         <NamedLayer><br>
                
<Name>boundaries</Name><br>
                
<UserStyle><br>
                        
<Title>xxx</Title><br>
                        
<FeatureTypeStyle><br>
                                
<Rule><br>
                                        
<PolygonSymbolizer><br>
                                                
<Fill><br>
                                                        
<CssParameter<br>
name="fill">#0000ff</CssParameter><br>
                                                
</Fill><br>
                                                
<Stroke><br>
                                                        
<CssParameter<br>
name="stroke">#ff0000</CssParameter><br>
                                                
</Stroke><br>
                                        
</PolygonSymbolizer><br>
                                
</Rule><br>
                        
</FeatureTypeStyle><br>
                
</UserStyle><br>
         
</NamedLayer><br>
</StyledLayerDescriptor><br><br>
<br><br>
#<br>
# Start of map file<br>
#<br><br>
NAME boundaries<br>
         STATUS ON<br>
         SIZE 600 300<br>
         EXTENT -180 -90 180
90<br>
         UNITS DD<br>
         SHAPEPATH
"data"<br>
         IMAGETYPE PNG<br>
         FONTSET
etc/fonts.txt<br><br>
<br><br>
         # Projection definition
---------------------<br><br>
         PROJECTION<br>
                
"init=epsg:4326"<br>
                
proj=latlong<br>
                
ellps=WGS84<br>
         END<br><br>
         # End Projection
definition ---------------------<br><br>
<br><br>
         # Web definition
---------------------<br><br>
         WEB<br>
                
HEADER demo_header.html<br>
                
TEMPLATE demo.html<br>
                
FOOTER demo_footer.html<br><br>
                
IMAGEPATH '../temp/'<br>
                
IMAGEURL 'temp/'<br><br>
                
METADATA<br>
                        
"wms_title" "boundaries"<br>
                        
"wms_onlineresource"<br>
"<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>
                
END<br>
         END<br><br>
         # End Web definition
---------------------<br><br>
<br><br>
         LAYER<br>
                
NAME boundaries<br>
                
TYPE POLYGON<br>
                
STATUS ON<br>
                
DATA boundaries<br>
                
DUMP TRUE<br>
                
CLASSITEM CNTRY_NAME<br>
                
CLASS<br>
                        
NAME 'boundaries'<br>
                        
OUTLINECOLOR 0 0 0<br>
                        
COLOR 100 100 100<br>
                        
TEMPLATE 'dummy'<br>
                
END<br>
                
METADATA<br>
                        
wms_title "boundaries"<br>
                
END<br>
         END<br><br>
END # Map File<br><br>
<br><br>
<br>
        
_______________________________________<br><br>
         Stefan Schwarzer<br>
         Consultant on
GEO<br><br>
        
UNEP/DEWA/GRID-Geneva<br>
         Chemin des Anemones
11<br>
         CH - 1219
Chatelaine<br>
         Switzerland<br><br>
         Tel: (+41)
22.917.83.49<br>
         Fax: (+41)
22.917.80.29<br><br>
         Email:
stefan.schwarzer at grid.unep.ch<br>
         Internet:
<a href="http://geodata.grid.unep.ch/" eudora="autourl">http://geodata.grid.unep.ch/</a><br>
        
_______________________________________</blockquote><br><br>
<br>
-- <br>
 </blockquote>
<x-sigsep><p></x-sigsep>
<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>

--=====================_107998234==.ALT--




More information about the MapServer-users mailing list