[Geoserver-devel] Re: [Geotools-devel] Virtual DataStores and Better Filter Functions

James, thanks for your replies;

That is true and it is a major limitation, though it is worth noting
that SLD allows you to use expressions so you can style features based
on expressions but there are many times when the ability to do the
calculation in advance or even to just rename an attribute, would be
handy. And, of course, there are all the analysis tasks that have
nothing to do with styling...

Unfortunately, the SLD does not allow you to run functions on Geometries
(the <geometry> tag only allows an <ogc:PropertyName>).

I'm just trying to buffer and union my polygons (see the pictures on the
first page of the wiki I sent) so I can do nice WMS (or WFS) in
Geoserver. And its neigh impossible under the OGC spec. You'd have
thought that this type of thing would be easy, but...

I think the expression stuff should be easy to add to Filter (if you
allow the <geometry> property to be an <expression> instead of a
<PropertyName>).

No one's made any comments on the Aggregation ("summary/group by")
virtual datastore.

I've used spatial databases a lot - perhaps I'm asking too much. I'd
love to be able to treat any of the datastores as a spatial database -
being able to send more complex queries to the store than just a dumbed
down row Filter. Unfortunately, thats much too much work.

I wanted to just change the JDBC datastore so it can point to views (its
already done, just not fully tested because it has FID issues) - then I
can just use Spatial DB in a Box (or whatever) to run "real" queries
against a dataset. But, I wanted to extend the functionality to people
who didnt have a spatial database (ie. people with shapefiles) - hence
the two types of virtual datastores.

Alternatively (jody likes this evil plan), I was considering just
providing functionality to "move" a shapefile (or whatever datastore)
to an imbedded spatial database (HSQLDB - which I've already
spatialized).

http://docs.codehaus.org/display/GEOS/Hsql+Bindings

How hard would it be to extend this so that he virtual DataStore
wrapped multiple DataStores? One of the other major limitations - to
my mind at least - with the current filter spec is that there is no
way to perform filters or expressions on multiple datasets. i.e. I
can do a dwithin operation on a specific hard coded point but I can't
to things like... all the points in DataStore A that are within
<expression> distance of lines in DataStore B. (Actualy, to my
knowledge thers is no way to do that even within a single GML file
that contains both the lines and the points but I could be wrong.)

The OGC Filter is pretty weak in terms of raw expressive power - but it
does allow you to do quite a bit.

I do mention, at the bottom of the summary page, a few thoughts on
joining two datasets together. Jody's done more thinking on this than
I.

The filter spec allows for user functions to be added. This can be

used as a mechanism for supporting simple classification.

Code to support this has already been writen for GeoVISTA studio, this

task will port that code to GeoTools.

How does GeoVISTA implement this and how does it compare to my
suggestion in the "OGC/Geotools Filter and Functions" section of
http://docs.codehaus.org/display/GEOS/selectDerivedFeatureType ?

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

>The filter spec allows for user functions to be added. This can be
used as a mechanism for supporting simple classification.
>
>Code to support this has already been writen for GeoVISTA studio, this
task will port that code to GeoTools.

How does GeoVISTA implement this and how does it compare to my
suggestion in the "OGC/Geotools Filter and Functions" section of
http://docs.codehaus.org/display/GEOS/selectDerivedFeatureType ?

It's all but identical I think. I should have the code in for a
simple EqualInterval classifier today so you can take a look.

One thing that I would like is a way to pass simple summery stats
functions off to capable data stores, you know max, min, mean...
Difucult to do as an open ended system but doable for a fixed set of
simple stats. (Oh and I should never have called the equivlelent of
Math.max(a,b) 'max' as it's use is very rare compared to 'max' in the
stats sense.

James

James, thanks for your replies;

>That is true and it is a major limitation, though it is worth noting
>that SLD allows you to use expressions so you can style features based
>on expressions but there are many times when the ability to do the
>calculation in advance or even to just rename an attribute, would be
>handy. And, of course, there are all the analysis tasks that have
>nothing to do with styling...

Unfortunately, the SLD does not allow you to run functions on Geometries
(the <geometry> tag only allows an <ogc:PropertyName>).

I was not aware of that limitation (I don't manipuate geometeries very
often), I'm on the SLD revision working group I'll see if I can get
that changed in the next version.

No one's made any comments on the Aggregation ("summary/group by")
virtual datastore.

It looks very powerful to me!

Alternatively (jody likes this evil plan), I was considering just
providing functionality to "move" a shapefile (or whatever datastore)
to an imbedded spatial database (HSQLDB - which I've already
spatialized).

It certanly makes for an interesting option, we would still need an
virtualDataStore if I understand this correctly, but it would use
HSQLDB.

No one's made any comments on the Aggregation ("summary/group by")
virtual datastore.
   
It looks very powerful to me!

This is exactly the sort of thing we have needed to do in practice, particularly when you have a sparsely sampled phenomena with potentially large numbers of localised samples.

I believe however you have just run into the world of coverages. Even a summary statistic bound to the "cell" of the filter geometry is technically a coverage. Thus, probably wise to look at the Web Coverage Service, although its very narrowly focussed on regular grids still. Maybe more importantly is to look at GML coverages.

Theory into practice may be useful : for example I'd envision an automatic creation of a meaningful ouput feature type (that directly references the underlying aggregated feature types) by conforming to the GML coverage model. Clients would thus be able to work out how to take the summary and using identifiers in predicatable places extract details from the underlying feature type. Looking at the model of coverages may help you factor the code better - it might help you envision future spatial aggregation capabilities better.

Rob Atkinson