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); } }