File file = JFileDataStoreChooser.showOpenFile("shp", null);
FileDataStore store = FileDataStoreFinder.getDataStore(file);
FeatureSource featureSource = store.getFeatureSource();
CachingFeatureSource cache = new CachingFeatureSource(featureSource);
MapContext map = new DefaultMapContext();
map.setTitle("Using cached features");
- For the longest time we have had a Query interface and a DefaultQuery implementation. These have been combined making code examples just that much readable.
- We introduced the use of Generics to support application schema work. While we now have a happy team working on application schema; it did impact readably.
Specifically FeatureCollection < SimpleFeatureType, SimpleFeature >
Introducing SimpleFeatureCollection to the rescue.
SimpleFeatureSource source = dataStore.getFeatureSource( typeName );
Query query = new Query( typeName, filter, attributes );
SimpleFeatureCollection features = source.getFeatures(query);