Reposting from here: http://jira.codehaus.org/browse/GEOS-529?page=comments
Hi,
I've been looking into this as a way of adding the optional TIME parameter, as specified in the OGC WMS Implementation Spec. 1.3.0.
My approach would be as follows:
1. Modify GetMapKvpReader to read in the TIME= parameter
2. Add time variable and get/set methods to GetMapRequest and WMSMapContext
3. Modify GetMapResponse.execute() so that the time query gets appended to definitionFilter before it is added to the layer here: layer.setQuery(definitionFilter);
According to the OGC spec. the time parameter should be passed in the following format in a GetMap request (dispensing with time interval for now..): 2000-06-18T14:30Z/2000-06-18T14:30Z
If I was to append this to the definitionFilter it would get passed in to the StreamingRenderer, but it would need to be converted to an OGC filter query first.
So my questions are:
1. Does this sound like a sensible way of getting the time parameter into an SQL query as made by Geotools (in the StreamingRenderer I guess)?
2. If so, where should I add the code to convert from the time parameter format shown above to an OGC to-from filter?
Thanks
Rob
[ Permlink ]
Comment by Robert Jones [22/May/06 11:03 AM]
On point 2 I should add - I guess the converter code could sit in GetMapResponse.execute(), though I suppose it would be more logical for it to reside with other filter methods somewhere.
Apologies for vagueness - I'm not that familiar with Geoserver/Geotools and it's my first time contributing to an open source project!
[ Permlink ]
Comment by Chris Holmes [22/May/06 11:21 AM]
Hey Robert, this type of thing you should email to the geoserver devel list, so that more people will see it.
You've found about the right path to add the time parameter, but the one problem is that it wouldn't be completely generic. The problem is which attribute should be the time? To make a filter you have to filter against a certain attribute, so that attribute would have to be set somewhere.
I think you're right in setting it in the definition filter, just AND it on when that filter is constructed in the GetMap response. It should't so much go in other filter methods, since it's WMS specific - your'e just using the filter implementation to accomplish it.
But I think you'd have to do something on the backend to let someone on GeoServer configure what parameter the TIME filter translates in to.
Though I suppose you could do something smart like check the attributeTypes on a feature to see if any of the attributes are dateTime. Note though that our date implementation has a couple little problems.