public void testFilter() throws Exception {
ReprojectingFeatureCollection rfc = new ReprojectingFeatureCollection(delegate, target);
ReferencedEnvelope bounds = delegate.getBounds();
ReferencedEnvelope rbounds = bounds.transform(target, true);
BBOX filter =
ff.bbox(
"",
bounds.getMinX(),
bounds.getMinY(),
bounds.getMaxX(),
bounds.getMaxY(),
CRS.toSRS(delegate.getSchema().getCoordinateReferenceSystem()));
BBOX rfilter =
ff.bbox(
"",
rbounds.getMinX(),
rbounds.getMinY(),
rbounds.getMaxX(),
rbounds.getMaxY(),
CRS.toSRS(target));
assertEquals(delegate.subCollection(filter).size(), rfc.subCollection(rfilter).size());
}