Re: [Geotools-devel] Idea: FeatureStream

2016-08-08 Thread Jody Garnett
the stream() method does not necessarily pull down all the data at runtime, the individual methods use predicates etc to cut down on what is obtained. For me the riskiest part of this idea is making Filter implement Predicate; because Predicates are usually typed, and our Filters are not typed. -

Re: [Geotools-devel] Idea: FeatureStream

2016-08-06 Thread Jim Hughes
On 8/6/2016 4:41 AM, Andrea Aime wrote: On Sat, Aug 6, 2016 at 9:01 AM, Jody Garnett > wrote: The sad part / danger / risk is that that our Filter interface would only be one kind of predicate, and I would expect normal java developers to make a query q

Re: [Geotools-devel] Idea: FeatureStream

2016-08-06 Thread Andrea Aime
On Sat, Aug 6, 2016 at 9:01 AM, Jody Garnett wrote: > The sad part / danger / risk is that that our Filter interface would only > be one kind of predicate, and I would expect normal java developers to make > a query quickly in java code - which is something we cannot optimize. > No objections to

Re: [Geotools-devel] Idea: FeatureStream

2016-08-06 Thread Jody Garnett
Yes, the point is to capture the provided predicate, and if it is one of our Filter objects we can pass it to the featureSource. Note this is a Filter object, since it is an object oriented language. Any given datastore is welcome to transform that into its own internal format for fun and profit, S

Re: [Geotools-devel] Idea: FeatureStream

2016-08-05 Thread Jim Hughes
Hi Devon, Jody, This looks exciting! For the (E)CQL filters as predicates, is there any chance those predicates could be passed down to the FeatureSource? Or would there be different execution from... featureSource.stream.filter(predicate) and featureSource.getFeatures(predicate).stream

Re: [Geotools-devel] Idea: FeatureStream

2016-08-05 Thread Jody Garnett
Reviewing the methods with Devon a lot of it looked pretty straight forward using FeatureSource and visitor. featureSource.stream().forEach( f -> System.out.println( f.getId() ) ); ); Once concern I had, well Kevin had, was how to handle predicates cleanly. There is an overlap of functionality

[Geotools-devel] Idea: FeatureStream

2016-08-05 Thread Devon Tucker
Hi all, Jody and I were talking today about and idea he has been agitating for a while. We'd like to basically implement the Java 8 streaming interface for features on top of FeatureSource or FeatureCollection. Just throwing this out there for early feedback to see what people think. Jody thinks