On Wednesday 10 October 2007 09:13:37 Andrea Aime wrote:
Lourens Veen ha scritto:
> Hello,
>
> What is the status of the complex-features branch? I've been trying to
> get it to build, but I can't even get the Geotools part of it to work.
> I've asked about that on the gt2-users mailinglist, but haven't had a
> reply yet. I'm hoping there's someone here who is working on cf. I seem
> to recall something on the wiki about merging it into mainline soon,
> perhaps that is half-done and that is the reason for my problems?
I wasn't involved in the complex feature branch so take what I say with
a grain of salt. Yet, afaik the branch is long dead, any attempt to
merge it as is has failed.
Ouch. That is bad news.
Thanks for your quick reply. Perhaps I should explain a bit more about my
problem then, to see if there is another possible solution.
I have a database with observations, and each observation has a location.
These locations are mostly standardised grid blocks, so that often many
observations share the same location. I have a client that has controls to
build a filter on the observations, and an OpenLayers map to retrieve and
display the relevant observations from a Geoserver WFS.
So far so good, except that I get lots of results (this is a _big_ database)
and drawing them all takes way too much time. Also, since many of the
observations are in the same position, there is no point in drawing all of
them. So, what I really want is not to get observations from the WFS, but
locations at which there was at least one observation with the properties
specified in the filter.
In SQL terms, I'd like something like
SELECT loc_geom, loc_id, COUNT(obs_id)
FROM locations NATURAL JOIN observations
WHERE [filter on columns of observations table]
GROUP BY loc_id;
I can select attributes using a PropertyName clause in my WFS query, I can
join locations and observations using a view in the DB, and I can do the
WHERE clause by specifying an OGC Filter in the WFS query. What I can't do is
the COUNT and GROUP BY (or DISTINCT ON).
So, when I saw http://docs.codehaus.org/display/GEOS/DerivedFeatureType I
figured that support for that was right around the corner, and then it
referred me to the ComplexDataStore project (this "community schema" support
is something else that I'll be needing in a while), which as I understand is
the complex-features branch in SVN, which doesn't build.
I'm considering either a very ugly (and hopefully very temporary) hack that
lets me pass a magic PropertyName that is rewritten into COUNT/GROUP BY
clauses somewhere deep inside the Geotools PostGIS plugin, or to have another
look at deegree WFS, which claims to offer complex features (I'm not sure if
it'll group them though, so that might not help any). I'd rather stick with
Geoserver though, because of its more open development model.
Thanks,
Lourens
--
ir. Lourens Veen Universiteit van Amsterdam - IBED
Nieuwe Achtergracht 166
Wetenschappelijk Programmeur 1018 WV Amsterdam, The Netherlands
EcoGRID-GAN tel: 020-5257453 fax: 020-5257431