On Fri, Oct 15, 2010 at 10:30 AM, Ricardo Bayley
<ricardo.bay...@gmail.com> wrote:
> Hi Fellows,
> Do you guys know if it is possible to combine AND and OR filters ?
> SQL Ej: (colA = 1 and colB = 2) or colC = 3
> SLD Ej.:
> <ogc:Filter>
> <ogc:And>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>colA</ogc:PropertyName>
> <ogc:Literal>1</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>colBĀ </ogc:PropertyName>
> <ogc:Literal>2</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:And>
> <ogc:Or>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>colC</ogc:PropertyName>
> <ogc:Literal>3</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:Or>
> </ogc:Filter>
>
> Does this makes any sense ?
> I have not tried it yet, just need something like this, and had no idea how
> to write it down.

Something like

<ogc:Filter>

<ogc:Or>

<ogc:And>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>colA</ogc:PropertyName>
<ogc:Literal>1</ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>colB </ogc:PropertyName>
<ogc:Literal>2</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>

<ogc:PropertyIsEqualTo>
<ogc:PropertyName>colC</ogc:PropertyName>
<ogc:Literal>3</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Or>
</ogc:Filter>


The Or filter must contain two filters so the And goes inside it.


Ian

-- 
Ian Turton

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to