I don't think that the OGC filter spec allows using a function to determine
a propertyname the way you describe. I believe GeoServer's if/then/else
could help if you really want to avoid repeating your styles (it is
implemented as a filter function).
However, the new SQL views functionality should make it pretty easy - you
can make a parameterized view (
http://docs.geoserver.org/stable/en/user/data/sqlview.html#parameters-and-validation)
and build your layer off of a SQL query like:
SELECT the_geom, %year% as year from my_real_table;
and include "viewparams=year:y2005" in requests to specify the year to use.
Your SLD would simply reference the "year" property.
--
David Winslow
OpenGeo - http://opengeo.org/
On Wed, Mar 16, 2011 at 11:24 PM, N L <[email protected]> wrote:
> Hello!
>
> I've got a layer with several columns like "y2005","y2006","y2007" and so
> on which represent population for a particular year.
> I want to be able to pass the column name to SLD in WMS request to tell the
> server to colour the features according to the year that user has defined.
>
> Is there any way to pass this parameter to the server?
> Or do i have to make tons of sld styles which are almost the same and the
> only difference is the value of <ogc:PropertyName> tag.
>
> Thank you.
>
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users