[Geoserver-devel] WMS GetMap FILTER Parameter

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.

Time parameter will be extremely usefull. For now I resorted to a hack
(again) and have the time stamp encoded into the CoverageType or
FeatureType name.

Alex

On 5/26/06, Robert William Jones <xbobwjones@...21...> wrote:

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.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Adding the TIME parameter would be a good thing indeed.

There are two deeper issues that spring to mind:

1) TIME is a "special case" of a dimension, same as 2D easting,northing, and height. The solution should be general enough to carry any dimension (additional to 2D) of the data, and map to request parameters. ideally, vendor-specific parameters should also be supported and be able to be mapped to expressions.

2) The DataStore API needs to expose its TIME, HEIGHT and other dimensions in a standard way, so that the mapping from the request to the data store (coverage or SQL or X...) can be implemented in a suitably flexible way.

TIME is particularly tricky becuase of issues of granularity and sparseness - if you have data every 3 days how do you respond to a request for a particular day for example?

This latter issue might be best discussed in an OGC forum, but I'd be happy to collaborate in a discussion amongst geoserver users that might inform the wider community. .

Regards
Rob Atkinson

Robert William Jones wrote:

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.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

I don't know that we should start with theoretical ideas best discussed in an OGC forum, or even with modifications to the datastore API. I think we should start with a use case, and design for that, and later we can make it more generic. Robert seems to have a nice, relatively simple use case, and I'd like to see what he comes up with. I think MapServer has some decent inspiration of a relatively simple way to get many of the basics: http://mapserver.gis.umn.edu/docs/howto/wms_time_support/

Robert, I think the place to configure the time output stuff is in each featureType's info.xml file. You can experiment with the timeextent and timedefault stuff like mapserver does, but I think the most important field would be the 'time field', which attribute of the data should be used to make the time query against.

As for now I think we should keep this a GeoServer thing, then I'd say stick the extra filter on to the definition filter in the renderer. I'm happy to review code, and I can try later to figure out where exactly the code should go, but I'd say just put it in the same place that the definition filter is defined.

best regards,

Chris

Rob Atkinson wrote:

Adding the TIME parameter would be a good thing indeed.

There are two deeper issues that spring to mind:

1) TIME is a "special case" of a dimension, same as 2D easting,northing, and height. The solution should be general enough to carry any dimension (additional to 2D) of the data, and map to request parameters. ideally, vendor-specific parameters should also be supported and be able to be mapped to expressions.

2) The DataStore API needs to expose its TIME, HEIGHT and other dimensions in a standard way, so that the mapping from the request to the data store (coverage or SQL or X...) can be implemented in a suitably flexible way.

TIME is particularly tricky becuase of issues of granularity and sparseness - if you have data every 3 days how do you respond to a request for a particular day for example?

This latter issue might be best discussed in an OGC forum, but I'd be happy to collaborate in a discussion amongst geoserver users that might inform the wider community. .

Regards
Rob Atkinson

Robert William Jones wrote:

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.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

How do you encode the timestamp into the CoverageType or FeatureType name in
WMS request? Possible to view any sample?

--
View this message in context: http://www.nabble.com/WMS-GetMap-FILTER-Parameter-tf1686852.html#a5741964
Sent from the GeoServer - Dev forum at Nabble.com.