From: <svn...@os...> - 2012-05-12 16:10:15
|
Author: aaime Date: 2012-05-12 09:10:08 -0700 (Sat, 12 May 2012) New Revision: 38717 Modified: trunk/modules/library/main/src/main/java/org/geotools/data/store/ReprojectingFeatureCollection.java trunk/modules/library/main/src/test/java/org/geotools/data/store/ReprojectingFeatureCollectionTest.java Log: [GEOT-4137] ReprojectingFeatureCollection.getBounds() not returning a ReferencedEnvelope with CRS, patch by Gerson Galang Modified: trunk/modules/library/main/src/main/java/org/geotools/data/store/ReprojectingFeatureCollection.java =================================================================== --- trunk/modules/library/main/src/main/java/org/geotools/data/store/ReprojectingFeatureCollection.java 2012-05-12 13:29:31 UTC (rev 38716) +++ trunk/modules/library/main/src/main/java/org/geotools/data/store/ReprojectingFeatureCollection.java 2012-05-12 16:10:08 UTC (rev 38717) @@ -241,7 +241,7 @@ newBBox.expandToInclude(internal); } } - return ReferencedEnvelope.reference(newBBox); + return new ReferencedEnvelope(newBBox, target); } catch (Exception e) { throw new RuntimeException( "Exception occurred while computing reprojected bounds", e); Modified: trunk/modules/library/main/src/test/java/org/geotools/data/store/ReprojectingFeatureCollectionTest.java =================================================================== --- trunk/modules/library/main/src/test/java/org/geotools/data/store/ReprojectingFeatureCollectionTest.java 2012-05-12 13:29:31 UTC (rev 38716) +++ trunk/modules/library/main/src/test/java/org/geotools/data/store/ReprojectingFeatureCollectionTest.java 2012-05-12 16:10:08 UTC (rev 38717) @@ -94,7 +94,9 @@ // 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()); } public void testFilter() throws Exception { |