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 between Predicates and our Filter interface - it would be great Filter could implement Predicate (allowing them to be used for java streams) and allowing us to detect the use of: Filter predicate = CQL.toFilter("attName >= 5"); boolean found = featureSource.stream().anyMatch( predicate ); featureSource.stream().filter( predicate ).forEach( f -> System.out.println( f.getId() ) ); ); Collection<Geometry> geoms = featureSource.stream().map( f -> (Geometry) f.getDefaultGeometry(); ).collect( Collectors.toList() ); -- Jody Garnett On 5 August 2016 at 14:45, Devon Tucker <devonrtuc...@gmail.com> wrote: > 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 that much of that API can be implemented in terms of the > existing functionality fairly simply/efficiently while others can be > delegated to simpler Stream objects (created from builder utilities). > > Interested in what people think. We'll probably do a quick proposal > shortly. > > Cheers, > Devon > > > ------------------------------------------------------------------------------ > > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel > >
------------------------------------------------------------------------------
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel