public void testBounds() throws Exception { ReprojectingFeatureCollection rfc = new ReprojectingFeatureCollection(delegate, target); ReferencedEnvelope bounds = delegate.getBounds(); // the reprojection of the full bounds is going to be bigger than the sum of the // feature by feature reprojected bounds assertTrue(bounds.transform(target, true).contains((BoundingBox) rfc.getBounds())); // make sure that the reprojected bounds contain the target CRS assertEquals(target, rfc.getBounds().getCoordinateReferenceSystem()); }
assertEquals(watcher.bounds, collection.getBounds());
public void testFilter() throws Exception { ReprojectingFeatureCollection rfc = new ReprojectingFeatureCollection(delegate, target); ReferencedEnvelope bounds = delegate.getBounds(); ReferencedEnvelope rbounds = bounds.transform(target, true); // check the bounds filtering works the same way in the standard and reprojected case 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()); }