[Geoserver-users] SLD's and ogc:Filter ranges

I’ve read that it’s possible to create an SLD that filters a range of values using the syntax below. I’m having trouble implementing this on a polygon data set with a field named AGEHHH that contains a range of values from 36.12345… - 56.1234… When I use the syntax indicated below, I get a “ServiceException” that says the style can’t be used with this layer.

  • Do I need to make sure that my SLD can deal with ALL values between 36.0 and 56.0, or can I write a filter that only displays a single value of the data set?
  • Is the data type (floating point) a problem?
  • Should I only apply the style rule to the fill, and have a generic stroke section?

Any clues someone can provide will be worth beer at the next conference. :wink:

<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc” xmlns:gml=“http://www.opengis.net/gml”>

ogc:And

ogc:PropertyIsLessThan
ogc:PropertyNameAGEHHH</ogc:PropertyName>
ogc:Literal38</ogc:Literal>
</ogc:PropertyIsLessThan>

ogc:PropertyIsGreaterThan
ogc:PropertyNameAGEHHH</ogc:PropertyName>
ogc:Literal36</ogc:Literal>
</ogc:PropertyIsGreaterThan>

</ogc:And>

</ogc:Filter>

#######  Using "PropertyIsBetween  ########
                   <ogc:Filter>
                        <ogc:PropertyIsBetween>
                            <ogc:PropertyName>AGEHHH</ogc:PropertyName>
                            <ogc:LowerBoundary><ogc:Literal>36.0</ogc:Literal></ogc:LowerBoundary>
                            <ogc:UpperBoundary><ogc:Literal>38.0</ogc:Literal></ogc:UpperBoundary>
                         </ogc:PropertyIsBetween>
                    </ogc:Filter>


Roger André
GIS Developer/Analyst
Enterprise Management Solutions

CH2M HILL
1100 112th Avenue NE
Suite 400
Bellevue, WA 98004
Direct 425.233.3042
roger.andre@anonymised.com

Developing People through Challenging Projects

It appears I can’t even symbolize a unique value, so I think there is something wrong with how I loaded the data into PostGIS. It seems like maybe the filter can’t read the attribute that I’m specifying, which is a little weird, because without any style applied, I’m able to click on a polygon and see the attribute data for it in the OpenLayers demo.


From: geoserver-users-bounces@lists.sourceforge.net [mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of Roger.Andre@anonymised.com
Sent: Thursday, January 31, 2008 12:31 PM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] SLD’s and ogc:Filter ranges

I’ve read that it’s possible to create an SLD that filters a range of values using the syntax below. I’m having trouble implementing this on a polygon data set with a field named AGEHHH that contains a range of values from 36.12345… - 56.1234… When I use the syntax indicated below, I get a “ServiceException” that says the style can’t be used with this layer.

  • Do I need to make sure that my SLD can deal with ALL values between 36.0 and 56.0, or can I write a filter that only displays a single value of the data set?
  • Is the data type (floating point) a problem?
  • Should I only apply the style rule to the fill, and have a generic stroke section?

Any clues someone can provide will be worth beer at the next conference. :wink:

<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc” xmlns:gml=“http://www.opengis.net/gml”>

ogc:And

ogc:PropertyIsLessThan
ogc:PropertyNameAGEHHH</ogc:PropertyName>
ogc:Literal38</ogc:Literal>
</ogc:PropertyIsLessThan>

ogc:PropertyIsGreaterThan
ogc:PropertyNameAGEHHH</ogc:PropertyName>
ogc:Literal36</ogc:Literal>
</ogc:PropertyIsGreaterThan>

</ogc:And>

</ogc:Filter>

#######  Using "PropertyIsBetween  ########
                   <ogc:Filter>
                        <ogc:PropertyIsBetween>
                            <ogc:PropertyName>AGEHHH</ogc:PropertyName>
                            <ogc:LowerBoundary><ogc:Literal>36.0</ogc:Literal></ogc:LowerBoundary>
                            <ogc:UpperBoundary><ogc:Literal>38.0</ogc:Literal></ogc:UpperBoundary>
                         </ogc:PropertyIsBetween>
                    </ogc:Filter>


Roger André
GIS Developer/Analyst
Enterprise Management Solutions

CH2M HILL
1100 112th Avenue NE
Suite 400
Bellevue, WA 98004
Direct 425.233.3042
roger.andre@anonymised.com

Developing People through Challenging Projects

Roger.Andre@anonymised.com ha scritto:

I've read that it's possible to create an SLD that filters a range of values using the syntax below. I'm having trouble implementing this on a polygon data set with a field named AGEHHH that contains a range of values from 36.12345.. - 56.1234... When I use the syntax indicated below, I get a "ServiceException" that says the style can't be used with this layer.

This usually happen when the property name and the actual attribute
name differ. Are you sure the feature type says AGEHHH and not agehhh?
SLD is case sensitive

Cheers
Andrea

You're correct, it was a difference in the case of the names that was
causing the problem.

Thanks for the feedback.
--
Roger

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Friday, February 01, 2008 12:29 AM
To: Andre, Roger/SEA
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SLD's and ogc:Filter ranges

Roger.Andre@anonymised.com ha scritto:

I've read that it's possible to create an SLD that filters a range of
values using the syntax below. I'm having trouble implementing this
on a polygon data set with a field named AGEHHH that contains a range
of values from 36.12345.. - 56.1234... When I use the syntax
indicated below, I get a "ServiceException" that says the style can't
be used with this layer.

This usually happen when the property name and the actual attribute name
differ. Are you sure the feature type says AGEHHH and not agehhh?
SLD is case sensitive

Cheers
Andrea