Thanks for your answer
This is the URL of the application i try to redevelop:
http://www.fao.org/figis/servlet/TabSelector.
It involves generating a map based on on user request.
In my configuration, I have now created a view in my Oracle database which
contains both Geographical and statistical values which has been added as a
featuretype in Geoserver.
I am not sure to well understand what your are sayingy "You have to create
the views and add them in Geoserver". Do you mean created a view for each
user request?
The point is that the query which is made against this view is different
acording to the user. It implies that the query result is unique to each
user and should be then be exploited by GeoServer to generate a map.
I succeed running some very simple queries on that fetauretype using
Ogc:Filter but i am lost when trying to write a more complex query.
Example:
This is the content of my view:
Geometry_|_ID_GEO_|_Year_|_Value
Polygon1_|__1______|_1999_|__5
Polygon1_|__1______|_1999_|__7
Polygon2_|__2______|_1999_|__4
Polygon2_|__2______|_1999_|__12
I want to get the sum of the value for the year 1999 for each ploygon to
obtain something like that:
Geometry_|_ID_GEO_|_Year_|_Value
Polygon1_|__1______|_1999_|__12
Polygon2_|__2______|_1999_|__16
I know that the SQL statement should be something like that:
SELECT Geometry,SUM(Value),ID_GEO FROM MyTable WHERE Year=1999 GROUP BY
ID_GEO but i don't know how to obtain this kind of query applying on my
featuretype by using ogc:filter.
Do you think it could work? Could i send the SQL query by code to the DB and
then use the result in Geoserver in order to generate a map?
The idea is to send through URL or other the query to the DB to get a result
directly usable by Geoserver. So it implies to include GeoServer in the
process such as having the view declared as a featuretype and running the
query through it, doesn't it?
I hope it is clear enough.
Many thanks for your help
Sylvain
David Winslow-3 wrote:
Hi Sylvain,
GeoServer doesn't support sending arbitrary SQL requests to databases.
I think for this you would need to have your own custom code create the
views in the database and then add them as new featuretypes in
GeoServer. Unfortunately automated configuration of GeoServer is not
very well supported right now. There is some example code on the wiki
at
http://geoserver.org/display/GEOSDOC/Alternative+for+reloading+the+Geoserver+catalog
for how to force a configuration reload after fixing up the
configuration files to add a new datastore. There is also work underway
on a REST API which should make this sort of thing much easier, but it's
pretty unpolished at this point. (see
http://geoserver.org/display/GEOSDOC/GeoServer+Resources)
Hope this helps,
David Winslow
springrider wrote:
Good afternoon
I have to run dynamic queries (SELECT..) on my Oracle database to extract
data. They will be done on a view which contains both statistical and
geographical.
The result should be then used by Geoserver 1.6.3 in order to generate a
map
based on a specific sld (quantile classification) showing value
associated
to each square of a grid.
My idea is to run these SQL queries against my DB through GeoServer.
Is it possible, how can i do that?
Many thanks for your help
Sylvain
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
View this message in context: http://www.nabble.com/Run-SQL-query-on-Oracle-through-GeoServer-tp17230606p17254756.html
Sent from the GeoServer - User mailing list archive at Nabble.com.