GridGeometry2D gg = coverage.getGridGeometry(); GeneralEnvelope padRange = CRS.transform(gg.getCRSToGrid2D(PixelOrientation.UPPER_LEFT), bounds); GridEnvelope2D targetRange = new GridEnvelope2D(
/** * Static method for taking the AffineTransform from the List * * @param list * @param index * @return */ private static AffineTransform getAffineTransform(GridGeometry2D gg2D, boolean grid2crs) { MathTransform2D tr = null; if (grid2crs) { tr = gg2D.getGridToCRS2D(PixelOrientation.UPPER_LEFT); } else { tr = gg2D.getCRSToGrid2D(PixelOrientation.UPPER_LEFT); } if (tr instanceof AffineTransform2D) { return (AffineTransform2D) tr; } else { throw new IllegalArgumentException(tr.toString() + " is not an AffineTransform"); } } }
MathTransform2D mt = getCRSToGrid2D(PixelOrientation.UPPER_LEFT);
throws TransformException, FactoryException, IOException { GridGeometry2D readingGridGeometry; MathTransform2D crsToGrid2D = gg.getCRSToGrid2D(); MathTransform2D gridToCRS2D = gg.getGridToCRS2D(); if (sameCRS) {
MathTransform2D mt = coverages.get(0).getGridGeometry().getCRSToGrid2D(); Rectangle rasterSpaceEnvelope; rasterSpaceEnvelope = CRS.transform(mt, targetEnvelope).toRectangle2D().getBounds();
this.requestedGridGeometry = new GridGeometry2D(new GridEnvelope2D(mapRasterArea), mapExtent); this.worldToScreen = requestedGridGeometry.getCRSToGrid2D(); this.padding = DEFAULT_PADDING; if (hints != null && hints.containsKey(GridCoverageRenderer.PADDING)) {
MathTransform2D mt = getCRSToGrid2D(PixelOrientation.UPPER_LEFT);
MathTransform w2gD = external.getCRSToGrid2D(PixelOrientation.UPPER_LEFT);