[Mapserver-users] SLD Problems

Bart van den Eijnden bartvde at xs4all.nl
Fri Mar 5 07:35:36 EST 2004


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/
>          _______________________________________



-- 
  



More information about the mapserver-users mailing list