Pedro,
We used the function “in3” as referenced at http://docs.geoserver.org/latest/en/user/filter/function_reference.html This supports in2 through in10. You may be able to match multiple features based on the ogc:or.
Here is an example of how we used it:
sld:Rule
sld:NameDefault Rule 1 to inf</sld:Name>
ogc:Filter
ogc:PropertyIsEqualTo
<ogc:Function name=“in3”>
<ogc:Function name=“geometryType”>
ogc:PropertyNamethe_geom</ogc:PropertyName>
</ogc:Function>
ogc:LiteralLineString</ogc:Literal>
ogc:LiteralLinearRing</ogc:Literal>
ogc:LiteralMultiLineString</ogc:Literal>
</ogc:Function>
ogc:Literaltrue</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
sld:LineSymbolizer
sld:Stroke
<sld:CssParameter name=“stroke-width”>.75</sld:CssParameter>
<sld:CssParameter name=“stroke”>#424242</sld:CssParameter>
</sld:Stroke>
</sld:LineSymbolizer>
</sld:Rule>
Your example
sld:Rule
sld:NameMatch MultipleFeatures</sld:Name>
ogc:Filter
ogc:Or
ogc:PropertyIsEqualTo
<ogc:Function name=“in3”>
ID
ogc:Literal1</ogc:Literal>
ogc:Literal2</ogc:Literal>
ogc:Literal3</ogc:Literal>
</ogc:Function>
ogc:Literaltrue</ogc:Literal>
</ogc:PropertyIsEqualTo>
ogc:PropertyIsEqualTo
<ogc:Function name=“in4”>
ID
ogc:Literal4</ogc:Literal>
ogc:Literal7</ogc:Literal>
ogc:Literal34</ogc:Literal>
ogc:Literal56</ogc:Literal>
</ogc:Function>
ogc:Literaltrue</ogc:Literal>
</ogc:PropertyIsEqualTo>
ogc:PropertyIsEqualTo
<ogc:Function name=“in2”>
ID
ogc:Literal98</ogc:Literal>
ogc:Literal322</ogc:Literal>
</ogc:Function>
ogc:Literaltrue</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Or>
</ogc:Filter>
</sld:Rule>

···
Chris Snider
Senior Software Engineer
Intelligent Software Solutions, Inc.
![Description: Description: Description: cid:image001.png@anonymised.com633...]()
From: Pedro Briones Garcia [mailto:pbg@anonymised.com]
Sent: Tuesday, June 11, 2013 2:20 AM
To: ‘geoserver-users@lists.sourceforge.net’
Subject: [Geoserver-users] How to group values in SLD
Hello.
First of all, excuse my poor English.
I have the following problem. I need to represent a lot of polygons (hundreds) in GeoServer with SLD_BODY option. The request is very long, so it is a problem in the client environment, because the request is cut and it doesn’t execute. I need to make it smaller.
I have hundred of polygons, but all polygons are painted with a color from five available, so instead of define a rule for each polygon, I would like to group all the polygons with the same symbol to reduce the length of the request. Is it possible to use something similar to “IN” operator to group values to represent?
How can I obtain somethin similar to:
ID
**1,2,3,4,7,34,65,98,322,…**
Thanks in advance
Best regards
Un saludo
|
Jefe de Grupo de Actuaciones y Proyectos
Gerencia de SIG y Consultoría
Grupo Tragsa (Grupo SEPI)
|
|
Julián Camarillo, 6B · Planta 2ªB
28037 Madrid
Tel.: +34 91 322 64 89
Fax: +34 91 322 64 48
pbg@anonymised.com…3477…
www.tragsa.es
|
En beneficio del medio ambiente, imprime este e-mail sólo si realmente es necesario.
El consumo de papel es perjudicial para el medio ambiente. Por favor, tengalo en cuenta antes de imprimir este mensaje.
AVISO LEGAL: Este mensaje y sus anexos pueden contener informacion confidencial o legalmente protegida. Esta dirigido unicamente a la persona o entidad indicada como destinatarios del mensaje. Si este mensaje le hubiera llegado por error, por favor eliminelo sin revisarlo ni reenviarlo y notifiquelo inmediatamente al remitente.