On Mon, Sep 19, 2011 at 1:15 PM, Gottfrid Linge
<[email protected]>wrote:

> Hi there!****
>
> ** **
>
> I use the PropertyIsBetween ogc filter to compare a property with some
> decimal values (upper boundary and lower boundary). My underlying property
> in geoserver is defined as a string and this is something I cannot change.
> When I compare values they are compared as strings and not as decimal
> values.****
>
> Is there a way to specifically convert the property to a decimal value in
> SLD so that values can be compared as numbers?
>

Is the data in a shapefile or in a database?

If it's a shapefile try wrapping the property name in a call to the
parseDouble filter function:

<Function name="parseDouble">
  <ogc:PropertyName>att</ogc:PropertyName>
</Function>

if it's a database the above will work but the filter won't be converted in
SQL anymore.
In that case I suggest you define a view in the database, or a sql view in
GeoServer,
that forcefully casts the string into a number using the database native
type
conversion features. That will most likely prevent the usage of eventual
indexes
on that column, but at least the filtering will be done by the database

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to