new ReadResolutionCalculator( gridGeometry, coverageProperties.crs2D, coverageProperties.fullResolution); calculator.setAccurateResolution(accurateResolution); computedResolution = calculator.computeRequestedResolution( ReferencedEnvelope.reference(computedBBox));
&& !destinationToSourceTransform.isIdentity()) { if (accurateResolution) { return computeAccurateResolution(readBounds); } else { return computeClassicResolution();
public ReadResolutionCalculator( GridGeometry2D requestedGridGeometry, CoordinateReferenceSystem nativeCrs, double[] fullResolution) throws FactoryException { Utilities.ensureNonNull("gridGeometry", requestedGridGeometry); this.requestedBBox = new ReferencedEnvelope((Envelope) requestedGridGeometry.getEnvelope2D()); this.requestedRasterArea = requestedGridGeometry.getGridRange2D().getBounds(); this.requestedGridToWorld = (AffineTransform) requestedGridGeometry.getGridToCRS2D(); this.fullResolution = fullResolution; // the reader might not know (e.g., wms cascading reader) in this case we // pick the classic computation results, it's better than nothing if (fullResolution == null) { this.fullResolution = computeClassicResolution(); isFullResolutionInRequestedCRS = true; } CoordinateReferenceSystem requestedCRS = requestedGridGeometry.getCoordinateReferenceSystem(); if (!CRS.equalsIgnoreMetadata(nativeCrs, requestedCRS)) { this.destinationToSourceTransform = CRS.findMathTransform(requestedCRS, nativeCrs); } }
new ReadResolutionCalculator( localGridGeometry, readerCRS, resolutionLevels != null ? resolutionLevels[0] : null); calculator.setAccurateResolution(isAccurateResolutionComputationSafe(readEnvelope)); double[] readResolution = calculator.computeRequestedResolution(reducedEnvelope); int width = (int)