[Geoserver-users] WMS Time SLD variable substitution

Hey everyone,

We are trying to create an SLD for a collection of points that styles a particular point differently based on the WMS TIME dimension. In the documentation for SLD parameter substitution (http://docs.geoserver.org/latest/en/user/styling/sld-extensions/substitution.html) there are predefined variables for BBOX, SRS, etc. However, there is not a variable for TIME. Is there currently another way to access this parameter within an SLD?

In org.geoserver.wms.GetMap on lines 496-507 the predefined variables are set using the EnvFunction.setLocalValue() method. Would adding support for TIME (and ELEVATION while we're at it) be as easy as setting "wms_time" just like the other variables?

Thanks,

Michael Romero
Software Engineer
Forward Slope, Inc.

On Mon, Aug 26, 2013 at 11:46 PM, Michael Romero
<mromero@anonymised.com>wrote:

Hey everyone,

We are trying to create an SLD for a collection of points that styles a
particular point differently based on the WMS TIME dimension. In the
documentation for SLD parameter substitution
(
http://docs.geoserver.org/latest/en/user/styling/sld-extensions/substitution.html
)
there are predefined variables for BBOX, SRS, etc. However, there is not
a variable for TIME. Is there currently another way to access this
parameter within an SLD?

No

In org.geoserver.wms.GetMap on lines 496-507 the predefined variables
are set using the EnvFunction.setLocalValue() method. Would adding
support for TIME (and ELEVATION while we're at it) be as easy as setting
"wms_time" just like the other variables?

Yes, that would be the way. However, the time at that point is available as
a parsed java.util.Date object, not in its original form, you can however
use
the Dispatcher.REQUEST thread local to grab it in its string form along with
all the raw request params (in the raw kvp field)

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------