@Test
public void testReprojectQuick() throws Exception {
// using CoverageProperties to build the SpatialRequestHelper
CoverageProperties coverageProperties = new CoverageProperties();
// source area in project crs
CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:27700");
ReferencedEnvelope sourceBBox = new ReferencedEnvelope(
414000,420000,
237000,301000,
sourceCRS);
coverageProperties.setBBox(sourceBBox);
coverageProperties.setCrs2D(sourceCRS);
//raster area
Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
coverageProperties.setRasterArea(sourceRasterArea);
// creating the g2d
final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
new GridEnvelope2D(sourceRasterArea),
sourceBBox);
AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
coverageProperties.setFullResolution(new double[]{
XAffineTransform.getScaleX0(sourceGridToWorldTransform),
XAffineTransform.getScaleY0(sourceGridToWorldTransform)
});
coverageProperties.setGeographicBBox(new ReferencedEnvelope(
-1.7973440460762267,-1.7061039437509753,
52.03105268214016,52.60660481087451,
DefaultGeographicCRS.WGS84));
coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
// now the target request
spatialRequestHelper.setAccurateResolution(false);
spatialRequestHelper.setRequestedGridGeometry(new GridGeometry2D(