try {
final GeneralEnvelope cropBBOXInRequestCRS = CRS.transform(cropBBox,
requestedBBox.getCoordinateReferenceSystem());
cropBBOXInRequestCRS.setCoordinateReferenceSystem(requestedBBox.getCoordinateReferenceSystem());
//make sure it falls within the requested envelope
cropBBOXInRequestCRS.intersect(requestedBBox);
//now go back to raster space
destinationRasterArea = new GeneralGridEnvelope(CRS.transform(requestedWorldToGrid,cropBBOXInRequestCRS),PixelInCell.CELL_CORNER,false).toRectangle();
//intersect with the original requested raster space to be sure that we stay within the requested raster area
XRectangle2D.intersect(destinationRasterArea, requestedRasterArea, destinationRasterArea);