[Geoserver-users] Filtering

Hi,

1. I understand that a request to the GeoServer can have filters in
it, as follows (in the xml form, not the url form):

http://localhost:8070/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&req
uest=GetMap&width=550&height=250&srs=EPSG:4326&SLD_BODY=

<StyledLayerDescriptor version="1.0.0">

            <UserLayer>

                        <Name>topp:states</Name>

                        <UserStyle>

                                    <Name>UserSelection</Name>

                                    <FeatureTypeStyle>

<Rule>

                                                            <Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;

<PropertyIsEqualTo>

<PropertyName>COUNTRY_NAME</PropertyName>

<Literal>USA</Literal>

</PropertyIsEqualTo>

                                                            </Filter>

<PolygonSymbolizer>

<Fill>

<CssParameter name="fill">#FF0000</CssParameter>

</Fill>

</PolygonSymbolizer>

                                                </Rule>

                                    </FeatureTypeStyle>

</UserStyle>

</UserLayer>

</StyledLayerDescriptor>

Can I filter with more than one condition (property)? How do I do it? Do I
repeat the filtering with another <Filter>, <PropertyIsEqualTo> or
<PropertyName> tag? I have tried all three but it doesn't seem to give me
the desired result.

2. And is it possible for me to do filtering for a range? Say, I
have a scenario where my data stores a column called minSpeed. Can I
actually filter out all the rows such that, say minSpeed < 50? If this is
possible, how can I go about doing it?

Hope someone can enlighten me on these issues. Greatly appreciate it and
thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---

Hi,

1. you probably need to use an ogc:And or an ogc:Or and nest in them the
separate PropertyIsEqualTo nodes. See the OGC Filter spec for details.

2. yes, use PropertyIsLessThan, also see the OGC filter spec for details.

Best regards,
Bart

Hi,

1. I understand that a request to the GeoServer can have filters
in
it, as follows (in the xml form, not the url form):

http://localhost:8070/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&req
uest=GetMap&width=550&height=250&srs=EPSG:4326&SLD_BODY=

<StyledLayerDescriptor version="1.0.0">

            <UserLayer>

                        <Name>topp:states</Name>

                        <UserStyle>

                                    <Name>UserSelection</Name>

                                    <FeatureTypeStyle>

<Rule>

                                                            <Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;

<PropertyIsEqualTo>

<PropertyName>COUNTRY_NAME</PropertyName>

<Literal>USA</Literal>

</PropertyIsEqualTo>

                                                            </Filter>

<PolygonSymbolizer>

<Fill>

<CssParameter name="fill">#FF0000</CssParameter>

</Fill>

</PolygonSymbolizer>

                                                </Rule>

                                    </FeatureTypeStyle>

</UserStyle>

</UserLayer>

</StyledLayerDescriptor>

Can I filter with more than one condition (property)? How do I do it? Do I
repeat the filtering with another <Filter>, <PropertyIsEqualTo> or
<PropertyName> tag? I have tried all three but it doesn't seem to give me
the desired result.

2. And is it possible for me to do filtering for a range? Say, I
have a scenario where my data stores a column called minSpeed. Can I
actually filter out all the rows such that, say minSpeed < 50? If this is
possible, how can I go about doing it?

Hope someone can enlighten me on these issues. Greatly appreciate it and
thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the
message
from your system; please do not copy or use it for any purpose, nor
disclose
its contents to any other person. Thank you.]
---ST Electronics Group---

Hi Lee Wai See,

            If you go to the OGC site and look at the OpenGIS spec page:
http://www.opengeospatial.org/specs/?page=specs you can download the

<http://portal.opengeospatial.org/files/?artifact_id=8340&gt; OpenGISR Filter
Encoding Implementation Specification It has many examples and a list of
the elements you can make use of in a filter.

<https://portal.opengeospatial.org/files/?artifact_id=1188&gt; OpenGISR Styled
Layer Descriptor (SLD) Implementation Specification (SLD) is another spec
worth reading.

Here is one example:

<Rule>

<ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;

  <ogc:And>

    <ogc:PropertyIsBetween>

      <ogc:PropertyName>UN_GRAD__C</ogc:PropertyName>

      <ogc:LowerBoundary>

        <ogc:Literal>81</ogc:Literal></ogc:LowerBoundary>

      <ogc:UpperBoundary>

        <ogc:Literal>160</ogc:Literal></ogc:UpperBoundary>

     </ogc:PropertyIsBetween>

     <ogc:And>

       <ogc:PropertyIsBetween>

         <ogc:PropertyName>UN_GRAD__C</ogc:PropertyName>

<ogc:LowerBoundary><ogc:Literal>100</ogc:Literal></ogc:LowerBoundary>

<ogc:UpperBoundary><ogc:Literal>102</ogc:Literal></ogc:UpperBoundary>

       </ogc:PropertyIsBetween>

       <ogc:PropertyIsBetween>

         <ogc:PropertyName>BOT_TEMP__</ogc:PropertyName>

         <ogc:LowerBoundary><ogc:Literal>0</ogc:Literal></ogc:LowerBoundary>

<ogc:UpperBoundary><ogc:Literal>360</ogc:Literal></ogc:UpperBoundary>

       </ogc:PropertyIsBetween>

     </ogc:And>

    </ogc:And>

</ogc:Filter>

<PointSymbolizer>

  <Graphic>

     <Mark>

      <WellKnownName>circle</WellKnownName>

       <Fill>

         <CssParameter name="fill">#FF6600</CssParameter>

         <CssParameter name="fill-opacity">1.0</CssParameter>

       </Fill>

     </Mark>

     <Size>6</Size>

  </Graphic>

</PointSymbolizer>

<PolygonSymbolizer>

  <Fill>

    <CssParameter name="fill">#FF6600</CssParameter>

  </Fill>

</PolygonSymbolizer>

</Rule>

  _____

From: geoserver-users-admin@lists.sourceforge.net
[mailto:geoserver-users-admin@lists.sourceforge.net] On Behalf Of Lee Wai
See
Sent: Tuesday, February 28, 2006 3:27 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Filtering

Hi,

1. I understand that a request to the GeoServer can have filters in
it, as follows (in the xml form, not the url form):

http://localhost:8070/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&req
uest=GetMap&width=550&height=250&srs=EPSG:4326&SLD_BODY=

<StyledLayerDescriptor version="1.0.0">

            <UserLayer>

                        <Name>topp:states</Name>

                        <UserStyle>

                                    <Name>UserSelection</Name>

                                    <FeatureTypeStyle>

<Rule>

                                                            <Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;

<PropertyIsEqualTo>

<PropertyName>COUNTRY_NAME</PropertyName>

<Literal>USA</Literal>

</PropertyIsEqualTo>

                                                            </Filter>

<PolygonSymbolizer>

<Fill>

<CssParameter name="fill">#FF0000</CssParameter>

</Fill>

</PolygonSymbolizer>

                                                </Rule>

                                    </FeatureTypeStyle>

</UserStyle>

</UserLayer>

</StyledLayerDescriptor>

Can I filter with more than one condition (property)? How do I do it? Do I
repeat the filtering with another <Filter>, <PropertyIsEqualTo> or
<PropertyName> tag? I have tried all three but it doesn't seem to give me
the desired result.

2. And is it possible for me to do filtering for a range? Say, I
have a scenario where my data stores a column called minSpeed. Can I
actually filter out all the rows such that, say minSpeed < 50? If this is
possible, how can I go about doing it?

Hope someone can enlighten me on these issues. Greatly appreciate it and
thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the
message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---