[Geoserver-users] How can I pass date argument through geoserver to PostgreSQL database?

Hi,

I am working on traffic visualization system with ability to check
history or future prediction.
I have system that generates traffic data for me, but I do not want
to store that data in my PostGIS database. I wrote a nice procedure to
get these data.
And also getLineColor(line_id, date) to get color of line to use in sld style.
Because date is a function argument I am not able to write a simple
database view.
How can I pass date argument through geoserver to PostgreSQL database?

I read about CQL filters and I found that they use functions. Can I
write my own filter-function to access PostgreSQL database ?

--
Rafał Magda

You could, the only question would be how to obtain a connection to it from the filter function. You cold use a jndi to look up the connection and it should work ok.

Look in the geotools main module [1] for lots of examples of how to implement filter functions. The spi plugin system [2] is used to register the functions.

-Justin

[1] http://svn.osgeo.org/geotools/trunk/modules/library/main/src/main/java/org/geotools/filter/function/

[2] http://svn.osgeo.org/geotools/trunk/modules/library/main/src/main/resources/META-INF/services/org.opengis.filter.expression.Function

On 3/30/10 8:12 AM, Rafał Magda wrote:

Hi,

I am working on traffic visualization system with ability to check
history or future prediction.
I have system that generates traffic data for me, but I do not want
to store that data in my PostGIS database. I wrote a nice procedure to
get these data.
And also getLineColor(line_id, date) to get color of line to use in sld style.
Because date is a function argument I am not able to write a simple
database view.
How can I pass date argument through geoserver to PostgreSQL database?

I read about CQL filters and I found that they use functions. Can I
write my own filter-function to access PostgreSQL database ?

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.