Hi!
I'm looking for a way to do complex queries in filters using GeoServer,
which includes kinds of SQL's subqueries... But my search isn't
successful... The most closer that I'm found was a Minnesota MapServer
configuration where a kind of SQL was passed to its "DataSource", like
showed bellow:
LAYER
CONNECTION "user=theuser password=thepass dbname=thedb host=theserver"
DATA "the_geom FROM (SELECT roads.oid AS oid, roads.the_geom AS the_geom,
road_names.name as name FROM roads LEFT JOIN road_names ON
roads.road_name_id = road_names.road_name_id)
AS named_roads USING UNIQUE oid USING SRID=-1"
MAXSCALE 20000
STATUS ON
TYPE ANNOTATION
LABELITEM name
CLASS
LABEL
ANGLE auto
SIZE 8
COLOR 0 192 0
TYPE truetype
FONT arial
END
END
END
The bold code is that I want a equivalent into GeoServer.
I hope be clear. 
Thanks for any ideia! =)
Jose
--
View this message in context: http://www.nabble.com/Is-there-something-like-this-in-GeoServer--tp22938643p22938643.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
zé ha scritto:
Hi!
I'm looking for a way to do complex queries in filters using GeoServer,
which includes kinds of SQL's subqueries... But my search isn't
successful... The most closer that I'm found was a Minnesota MapServer
configuration where a kind of SQL was passed to its "DataSource", like
showed bellow:
LAYER CONNECTION "user=theuser password=thepass dbname=thedb host=theserver" DATA "the_geom FROM (SELECT roads.oid AS oid, roads.the_geom AS the_geom, road_names.name as name FROM roads LEFT JOIN road_names ON roads.road_name_id = road_names.road_name_id) AS named_roads USING UNIQUE oid USING SRID=-1" MAXSCALE 20000 STATUS ON TYPE ANNOTATION LABELITEM name
CLASS LABEL ANGLE auto SIZE 8 COLOR 0 192 0 TYPE truetype FONT arial
END
END END
The bold code is that I want a equivalent into GeoServer.
There is no equivalent in GeoServer configuration wise.
But GeoServer can deal with views just as with tables,
so you can create a view in your database performing the
query you want, register it in the spatial metadata tables
(geometry_columns if you're using postgis) and use it
from GeoServer, read only, as if it was a normal table.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
Hi,
The Geoserver way is to make a view in the database from the SQL query, register the view in geometry_columns (PostGIS) or user_sdo_geom_metadata (Oracle) and use that view as a datasource. Unfortunately having the inner select clause can make spatial index unusable but that depends on the query and the structure of the database.
-Jukka Rahkonen-
zé wrote:
Hi!
I'm looking for a way to do complex queries in filters using GeoServer,
which includes kinds of SQL's subqueries... But my search isn't
successful... The most closer that I'm found was a Minnesota MapServer
configuration where a kind of SQL was passed to its "DataSource", like
showed bellow:
LAYER
CONNECTION "user=theuser password=thepass dbname=thedb host=theserver"
DATA "the_geom FROM (SELECT roads.oid AS oid, roads.the_geom AS the_geom,
road_names.name as name FROM roads LEFT JOIN road_names ON
roads.road_name_id = road_names.road_name_id)
AS named_roads USING UNIQUE oid USING SRID=-1"
MAXSCALE 20000
STATUS ON
TYPE ANNOTATION
LABELITEM name
CLASS
LABEL
ANGLE auto
SIZE 8
COLOR 0 192 0
TYPE truetype
FONT arial
END
END
END
The bold code is that I want a equivalent into GeoServer.
I hope be clear. 
Thanks for any ideia! =)
Jose
--
View this message in context: http://www.nabble.com/Is-there-something-like-this-in-GeoServer--tp22938643p22938643.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users