//
final CoordinateReferenceSystem subsettingCRS = extractSubsettingCRS(reader, extensions);
final CoordinateReferenceSystem outputCRS = extractOutputCRS(reader, extensions,
subsettingCRS);
WCSDimensionsSubsetHelper subsetHelper = new WCSDimensionsSubsetHelper(reader, request, ci, subsettingCRS, envelopeDimensionsMapper);
// extract dimensions subsetting
GridCoverageRequest requestSubset = subsetHelper.createGridCoverageRequestSubset();
//
// Handle interpolation extension
//
// notice that for the moment we support only homogeneous interpolation on the 2D axis
final Map<String, InterpolationPolicy> axesInterpolations = extractInterpolation(reader,
extensions);
final Interpolation spatialInterpolation = extractSpatialInterpolation(axesInterpolations,
reader.getOriginalEnvelope());
final OverviewPolicy overviewPolicy = extractOverviewPolicy(extensions);
// TODO time interpolation
assert spatialInterpolation != null;
// build the grid coverage request
GridCoverageRequest gcr = new GridCoverageRequest();
gcr.setOutputCRS(outputCRS);
gcr.setSpatialInterpolation(spatialInterpolation);
gcr.setSpatialSubset(requestSubset.getSpatialSubset());
gcr.setTemporalSubset(requestSubset.getTemporalSubset());
gcr.setElevationSubset(requestSubset.getElevationSubset());
gcr.setDimensionsSubset(requestSubset.getDimensionsSubset());
gcr.setFilter(request.getFilter());
gcr.setOverviewPolicy(overviewPolicy);
subsetHelper.setGridCoverageRequest(gcr);
return subsetHelper;
}