AbstractGridCoverage2DReader reader = (AbstractGridCoverage2DReader) cinfo.getGridCoverageReader(null, null);
bounds = new ReferencedEnvelope(reader.getOriginalEnvelope());
// apply the bounds, taking into account the reprojection policy if need be
if (resourceInfo.getProjectionPolicy() == ProjectionPolicy.REPROJECT_TO_DECLARED && bounds != null) {
try {
bounds = bounds.transform(resourceInfo.getCRS(), true);
GridGeometry grid = ((CoverageInfo) resourceInfo).getGrid();
((CoverageInfo) resourceInfo).setGrid(new GridGeometry2D(grid.getGridRange(),grid.getGridToCRS(), resourceInfo.getCRS()));
} catch(Exception e) {
throw (IOException) new IOException("transform error").initCause(e);
}