Hi, there is a bit of activity in this space -
Gabriel Roldan wrote a extension to the JDBC data stroe to allow registering an in-process SQL view:
its in geotools 2.4, community-schemas/sql-datastore.
The “geometryless” datastore implements these interfaces, and hence we can use SQL statements like:
select site.site as station_id ,
site.stname as station_name, site.stream as stream,
parmkey as determinand_code,
parmkey as determinand_description,
datetime as sample_time_position,
unitcode as units,
value as result, latitude, longitude
from awdip.tsdata tsdata, awdip.site site
where
tsdata.orgcode=‘qwr’
and site.orgcode = tsdata.orgcode
and
tsdata.site = site.site
to extract virtual features out of the database.
We will be trying to work out a transition plan for this capability to the JDBC baseline, but one could hack an existing datastore, such as postgis, to implement these interfaces and inherit the capabilities (we did exactly this on a branch a while back).
I’m not sure of the status of postgis et al in terms of being able to use a native SQL view instead of a database table, but I’d try that first.
If you dont need lines and polygons, possibly geometryless will work for you. The vast majority of geo-referenced business data is in multiple tables with point locations, or references to named features. Geometryless was designed to enable the former. Getting SQL-datastore extensions into the core would enable them all.
Regards
Rob Atkinson
On Sat, Jun 28, 2008 at 6:40 AM, Andrea Aime <aaime@anonymised.com> wrote:
Dave Potts ha scritto:
I have been looking into replacing an instance of mapserver with
geoserver. But to do this I need to access several different tables in
my database.
I have been through the source code and the on line help and there
does’nt seem to be a way of building a request from more than one data
table in a datasource, is this correct or have I missed something vitial.
There is no way to specify a SQL query in the configuratin, but you
can build a view, register it against the metadata tables of your
dbms so that it looks like a geometric table, and you’re done,
you can register the view as if it was a simple table.
You’re still limited to simple features thought, whatever is
the result of your view, it will be served as a flat table
(and be read only as well).
Hope this helps
Cheers
Andrea
Check out the new SourceForge.net Marketplace.
It’s the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel