RasterGeoReference nGeoRef = resolution.createGeoReference( getRasterReference().getOriginLocation(), spatialExtent ); RasterRect rect = nGeoRef.convertEnvelopeToRasterCRS( spatialExtent ); GeometryTransformer gt = new GeometryTransformer( getCoordinateSystem() ); Envelope inLocalCRS = gt.transform( spatialExtent ).getEnvelope(); RasterGeoReference nGeoRef = resolution.createGeoReference( getRasterReference().getOriginLocation(), inLocalCRS ); rect = nGeoRef.convertEnvelopeToRasterCRS( inLocalCRS );