[Schmitzm-commits] r583 - branches/1.0-gt2-2.6/src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 26 15:22:57 CET 2009


Author: alfonx
Date: 2009-11-26 15:22:57 +0100 (Thu, 26 Nov 2009)
New Revision: 583

Modified:
   branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java
Log:
Much more efficitent to implement  getFeatureCollectionFiltered() with getFeatureSource().getFeature(filter) than creating a memoryFeatureCollection adnuse subfeatures on that!

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java	2009-11-26 14:21:45 UTC (rev 582)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java	2009-11-26 14:22:57 UTC (rev 583)
@@ -303,12 +303,18 @@
 
 	@Override
 	public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollectionFiltered() {
-		final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection();
-		if (filter == Filter.EXCLUDE)
-			return new EmptyFeatureCollection(fc.getSchema());
-		if (filter == Filter.INCLUDE)
-			return fc;
-		return fc.subCollection(filter);
+//		final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection();
+//		if (filter == Filter.EXCLUDE)
+//			return new EmptyFeatureCollection(fc.getSchema());
+//		if (filter == Filter.INCLUDE)
+//			return fc;
+//		return fc.subCollection(filter);
+		
+		try {
+			return getFeatureSource().getFeatures(filter);
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
 	}
 
 	@Override



More information about the Schmitzm-commits mailing list