[mapserver-users] Using applySLD and generateSLD with Mapscript Python

Guillaume Sueur no-reply at neogeo-online.net
Tue Dec 6 04:54:38 EST 2011


Hi list,

I'm playing with mapscript python and SLD files, and having some kinds 
of troubles.
It seems that applySLD doesn't build an EXPRESSION tag for the CLASS it 
refers too.
Starting from a mapfile with CLASS and EXPRESSION set, the SLD body 
generated is correct :
<Rule>
<Name>VELOV</Name>
<ogc:Filter><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>nbbornettes</ogc:PropertyName><ogc:Literal>20</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:Filter>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#993300</CssParameter>
</Fill>
</Mark>
<Size>8</Size>
</Graphic>
</PointSymbolizer>
</Rule>

but applying this same SLD file to the mapfile via mapscript gives only 
a FILTER set:
FILTER  ("nbbornettes">= 20)
...
CLASS
       NAME "VELOV"
       STYLE
         ANGLE 0
         COLOR 153 51 0
         OFFSET 0 0
         SIZE 8
         SYMBOL "sld_mark_symbol_square_filled"
       END # STYLE
     END # CLASS

The matching between SLd Filters and Classes has been lost. It means 
that you can't build any SLD file with more than one class/filter and 
see them drawn on the map.
I 'm using mapscript 6.0.1

Thanks for any clue

Best regards

Guillaume



More information about the mapserver-users mailing list