If you’re using Geoserver as your WMS server there’s a very useful add on
built in version 2.0.2 and up called variable substitution in SLD. 

Please see http://docs.geoserver.org/2.0.x/en/user/services/wms/vendor.html
(parameter ENV). With this you can have SLD template I just make the
substitutions for the values you want, but if all 400 rules are applied for
rendering the map in that request this can’t help you.

 

Cheers,

Pedro Mendes

 

De: [email protected] [mailto:[email protected]] Em
nome de Özkan, Ayhan
Enviada: quarta-feira, 23 de Junho de 2010 09:23
Para: [email protected]
Assunto: [OpenLayers-Users] How many rules in SLD

 

Hi, 

does anybody know how many rules are allowed in SLD? The rules are created
in a foreach loop.

 

<script type="text/javascript">

var map,landkreise;

…..

theSLD_BODY='<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengeospatial.net/sld/1.0.0/StyledLayerDescriptor.xsd";>';

    theSLD_BODY +='<NamedLayer>';

    theSLD_BODY +=' <Name>testdaten</Name>';

    theSLD_BODY +=' <UserStyle>';

    theSLD_BODY +=' <FeatureTypeStyle>';

[%- FOREACH rule IN Rules %]

    theSLD_BODY +='   <Rule>';

    theSLD_BODY +='     <ogc:Filter>';

    theSLD_BODY +='       <ogc:PropertyIsLike wildCard="*" singleChar="."
escape="!">';

    theSLD_BODY +='         <ogc:PropertyName>[% rule.field
%]</ogc:PropertyName>';

    theSLD_BODY +='         <ogc:Literal>[% rule.value %]</ogc:Literal>';

    theSLD_BODY +='       </ogc:PropertyIsLike>';

    theSLD_BODY +='     </ogc:Filter>';

    theSLD_BODY +='     <PolygonSymbolizer>';

    theSLD_BODY +='       <Fill>';

    theSLD_BODY +='         <CssParameter name="fill">[%- rule.color
-%]</CssParameter>';

    theSLD_BODY +='       </Fill>';

    theSLD_BODY +='       <Stroke>';

    theSLD_BODY +='         <CssParameter
name="stroke">#000000</CssParameter>';

    theSLD_BODY +='         <CssParameter
name="stroke-width">2</CssParameter>';

    theSLD_BODY +='       </Stroke>';

    theSLD_BODY +='     </PolygonSymbolizer>';

    theSLD_BODY +='   </Rule>';

[% END %]

theSLD_BODY +='</FeatureTypeStyle>   </UserStyle>
</NamedLayer></StyledLayerDescriptor>';

//

landkreise.mergeNewParams({"SLD_BODY" : theSLD_BODY});

……

</script>

Does anybody have another solution for coloring the map for more than 400
rules?

Thanks in advance


Ayhan Özkan 

                

 

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to