For the udig "reshape" operation that does the same cql thing you are refering 
to I used the first feature in the source collection to determine the result 
type. Not perfect but there you go.

in the past  when talking about setting up a "feature chaining" (similar to a 
jai image processing chain) we talked about setting up two execution paths  - 
one for description and one for data.

Since that time our expression system actually stands a chance of supporting 
that.

So to cover description:
- return a MultiPolygon.class when passed a Point.class 

And then the usual value execution path:
- return a MultiPolygon object when passed a Point object.


You could also consider using an GeometryDescriptor and getting back a 
GeometryDescriptor?

Jody

On 27/07/2010, at 6:32 PM, Andrea Aime wrote:

> Hi,
> today I was trying to create a process that would make
> up for some limitations of the WFS GetFeature operation,
> in particular the inability to compute on the fly new
> attribute.
> I'd like to be able to define new attribute in the
> returned collection as:
> 
> <ecql expression> as newname
> 
> There is however a big catch in all of this: how do
> I create the target schema?
> I know the new attribute name, but not its type.
> For example, given:
> 
> buffer(the_geom, 20) as bufferedgeom
> 
> how do I get to know it's going to be a Geometry?
> The filter function implementations offer nothing
> about their return type.
> 
> And, correct me if I'm wrong, without a proper schema
> it's not possible to drive a xml encoding or a shapefile
> encoding.
> 
> A silly approach could be to run the new attributes against
> the first feature and see what type the transformed object
> is, but that would fall apart if the_geom is null for that
> attribute. Or one could make it go through all of the
> input features, serialize the results to avoid recomputing it,
> and try to summarize the result type by inspection of all
> results. Which would still fail if all of the attributes
> involved in the transformation are null...
> 
> Hmmm.... bright ideas, suggestions?
> 
> Cheers
> Andrea
> 
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to