Multiple FeatureTypeStyle in a UserStyle

Yewondwossen Assefa assefa at DMSOLUTIONS.CA
Wed Apr 4 22:21:24 EDT 2007


Hi There,

  Looking at your sld, It seems that  your intention to do some kind of 
casing style (one class with 2 styles in mapserver sense) ?  If that is 
the case, you should use only one rule with 2 LineSymbolizers. Something 
like this would work :

<NamedLayer>
<Name>test</Name>
<UserStyle>
  <FeatureTypeStyle>
   <Rule>
    <LineSymbolizer>
     <Stroke>
      <CssParameter name="stroke">#666666</CssParameter>
      <CssParameter name="stroke-width">7</CssParameter>
     </Stroke>
    </LineSymbolizer>
    <LineSymbolizer>
     <Stroke>
      <CssParameter name="stroke">#FFFFFF</CssParameter>
      <CssParameter name="stroke-width">4</CssParameter>
     </Stroke>
    </LineSymbolizer>
   </Rule>
  </FeatureTypeStyle>
  </UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

  If not could you explain what your intention is with this sld.  Note 
that in the sld you sent, each rule is translated into a class element 
so you end up with 2 classes (none of which contains an expression) and 
mapserver renders the features using the first class.

Later,


Jackey Cheung wrote:
> Greetings!
> 
> I'm try the SLD on ms4w 4.10 now, and got a problem.
> 
> I've put 2 <FeatureTypeStyle> blocks in a userstyle:
> 
> <NamedLayer>
> <Name>test</Name>
> <UserStyle>
>  <FeatureTypeStyle>
>   <Rule>
>    <LineSymbolizer>
>     <Stroke>
>      <CssParameter name="stroke">#666666</CssParameter>
>      <CssParameter name="stroke-width">7</CssParameter>
>     </Stroke>
>    </LineSymbolizer>
>   </Rule>
>  </FeatureTypeStyle>
>  <FeatureTypeStyle>
>   <Rule>
>    <LineSymbolizer>
>     <Stroke>
>      <CssParameter name="stroke">#FFFFFF</CssParameter>
>      <CssParameter name="stroke-width">4</CssParameter>
>     </Stroke>
>    </LineSymbolizer>
>   </Rule>
>  </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
> 
> But it seems that MapServer only draws the second FeatureTypeStyle only.
> 
> Why's that?


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-users mailing list