[OpenLayers-Users] How many rules in SLD

Pedro Mendes pmendes at xlm.pt
Wed Jun 23 09:18:32 EDT 2010


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: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Em
nome de Özkan, Ayhan
Enviada: quarta-feira, 23 de Junho de 2010 09:23
Para: users at openlayers.org
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 

		

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100623/9a54dd48/attachment.html


More information about the Users mailing list