41 |
|
|
42 |
import org.apache.log4j.Logger; |
import org.apache.log4j.Logger; |
43 |
import org.geotools.data.FeatureSource; |
import org.geotools.data.FeatureSource; |
|
import org.geotools.data.store.EmptyFeatureCollection; |
|
44 |
import org.geotools.feature.FeatureCollection; |
import org.geotools.feature.FeatureCollection; |
45 |
import org.geotools.styling.Style; |
import org.geotools.styling.Style; |
46 |
import org.opengis.feature.simple.SimpleFeature; |
import org.opengis.feature.simple.SimpleFeature; |
302 |
|
|
303 |
@Override |
@Override |
304 |
public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollectionFiltered() { |
public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollectionFiltered() { |
305 |
final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection(); |
// final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection(); |
306 |
if (filter == Filter.EXCLUDE) |
// if (filter == Filter.EXCLUDE) |
307 |
return new EmptyFeatureCollection(fc.getSchema()); |
// return new EmptyFeatureCollection(fc.getSchema()); |
308 |
if (filter == Filter.INCLUDE) |
// if (filter == Filter.INCLUDE) |
309 |
return fc; |
// return fc; |
310 |
return fc.subCollection(filter); |
// return fc.subCollection(filter); |
311 |
|
|
312 |
|
try { |
313 |
|
return getFeatureSource().getFeatures(filter); |
314 |
|
} catch (IOException e) { |
315 |
|
throw new RuntimeException(e); |
316 |
|
} |
317 |
} |
} |
318 |
|
|
319 |
@Override |
@Override |