[Geoserver-users] SLD filtering question

Hi,
a question not strictly related to GeoServer (sorry). It's about SLD
filtering:
I have all the point data in a postGIS table. I want to show only data of a
certain userID.
Then, I want the user to dynamically classify this data by different genus
(allways keeping in mind that only the userID data must be shown).

I thought that something like this should work:
<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
          
  </AND>
</Filter>

( this Filter is inserted in the WebMap Context XML file and can be
manipulated by the user via AJAX/php )

But it doesn't work (it just doesn't show anything). It works if I only put
a <PropertyIsEqualTo> filter.
I've also tried to put an <OR> tag like this, but no success:

<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
   <OR>
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
   </OR>
  </AND>
</Filter>

Some help?
thanks,

Pere Roca
Museo Nacional Ciencias Naturales
EDIT project (www.e-taxonomy.eu/)
http://edit.csic.es
--
View this message in context: http://www.nabble.com/SLD-filtering-question-tf4838350.html#a13842065
Sent from the GeoServer - User mailing list archive at Nabble.com.

Pere,

The first filter will certainly not work. The second filter is what you
want, and should give results if the data is present. Try changing AND
to And, and OR to Or and see if you get different results (I think I've
had case sensitivity issues in the past in my SLDs).

John Fletcher

-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of pere
roca
Sent: Monday, November 19, 2007 10:30 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] SLD filtering question

Hi,
a question not strictly related to GeoServer (sorry). It's about SLD
filtering:
I have all the point data in a postGIS table. I want to show only data
of a certain userID.
Then, I want the user to dynamically classify this data by different
genus (allways keeping in mind that only the userID data must be shown).

I thought that something like this should work:
<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
          
  </AND>
</Filter>

( this Filter is inserted in the WebMap Context XML file and can be
manipulated by the user via AJAX/php )

But it doesn't work (it just doesn't show anything). It works if I only
put a <PropertyIsEqualTo> filter.
I've also tried to put an <OR> tag like this, but no success:

<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
   <OR>
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
   </OR>
  </AND>
</Filter>

Some help?
thanks,

Pere Roca
Museo Nacional Ciencias Naturales
EDIT project (www.e-taxonomy.eu/)
http://edit.csic.es
--
View this message in context:
http://www.nabble.com/SLD-filtering-question-tf4838350.html#a13842065
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Verified. I just did a little test and changing from "AND" to "And" does
make the difference. Also, just so everything is above board you may
wish to try validating your sld document with the geoserver style
editor. These kinds of things will be caught by that.

-Justin

John Fletcher wrote:

Pere,

The first filter will certainly not work. The second filter is what you
want, and should give results if the data is present. Try changing AND
to And, and OR to Or and see if you get different results (I think I've
had case sensitivity issues in the past in my SLDs).

John Fletcher

-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of pere
roca
Sent: Monday, November 19, 2007 10:30 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] SLD filtering question

Hi,
a question not strictly related to GeoServer (sorry). It's about SLD
filtering:
I have all the point data in a postGIS table. I want to show only data
of a certain userID.
Then, I want the user to dynamically classify this data by different
genus (allways keeping in mind that only the userID data must be shown).

I thought that something like this should work:
<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
          
  </AND>
</Filter>

( this Filter is inserted in the WebMap Context XML file and can be
manipulated by the user via AJAX/php )

But it doesn't work (it just doesn't show anything). It works if I only
put a <PropertyIsEqualTo> filter.
I've also tried to put an <OR> tag like this, but no success:

<Filter>
   <AND>
    <PropertyIsEqualTo>
  <PropertyName>userID</PropertyName>
            <Literal>ID of the user</Literal>
    </PropertyIsEqualTo>
    
   <OR>
    <PropertyIsEqualTo>
        <PropertyName>genus</PropertyName>
             <Literal>ciconia</Literal>
    </PropertyIsEqualTo>
   
    <PropertyIsEqualTo>
         <PropertyName>genus</PropertyName>
              <Literal>copris</Literal>
    </PropertyIsEqualTo>
   </OR>
  </AND>
</Filter>

Some help?
thanks,

Pere Roca
Museo Nacional Ciencias Naturales
EDIT project (www.e-taxonomy.eu/)
http://edit.csic.es
--
View this message in context:
http://www.nabble.com/SLD-filtering-question-tf4838350.html#a13842065
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4741e93624753327367457!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

yes, it’s true, it works now…

Thanks!

2007/11/19, Justin Deoliveira <jdeolive@anonymised.com>:

Verified. I just did a little test and changing from “AND” to “And” does
make the difference. Also, just so everything is above board you may
wish to try validating your sld document with the geoserver style
editor. These kinds of things will be caught by that.

-Justin

John Fletcher wrote:

Pere,

The first filter will certainly not work. The second filter is what you
want, and should give results if the data is present. Try changing AND
to And, and OR to Or and see if you get different results (I think I’ve
had case sensitivity issues in the past in my SLDs).

John Fletcher

-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net ] On Behalf Of pere
roca
Sent: Monday, November 19, 2007 10:30 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] SLD filtering question

Hi,
a question not strictly related to GeoServer (sorry). It’s about SLD
filtering:
I have all the point data in a postGIS table. I want to show only data
of a certain userID.
Then, I want the user to dynamically classify this data by different
genus (allways keeping in mind that only the userID data must be shown).

I thought that something like this should work:



userID
ID of the user

genus ciconia genus copris

( this Filter is inserted in the WebMap Context XML file and can be
manipulated by the user via AJAX/php )

But it doesn’t work (it just doesn’t show anything). It works if I only
put a filter.
I’ve also tried to put an tag like this, but no success:

userID ID of the user genus ciconia genus copris

Some help?
thanks,

Pere Roca
Museo Nacional Ciencias Naturales
EDIT project (www.e-taxonomy.eu/)
http://edit.csic.es

View this message in context:
http://www.nabble.com/SLD-filtering-question-tf4838350.html#a13842065
Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4741e93624753327367457!


Justin Deoliveira
The Open Planning Project
http://topp.openplans.org