/** * Constructs a new grid geometry identical to the specified one except for the CRS. Note that * this constructor just defines the CRS; it does <strong>not</strong> reproject the envelope. * For this reason, this constructor should not be public. It is for internal use by {@link * GridCoverageFactory} only. */ GridGeometry2D(final GridGeometry2D gm, final CoordinateReferenceSystem crs) { super(gm, crs); gridDimensionX = gm.gridDimensionX; gridDimensionY = gm.gridDimensionY; axisDimensionX = gm.axisDimensionX; axisDimensionY = gm.axisDimensionY; gridFromCRS2D = gm.gridFromCRS2D; gridToCRS2D = gm.gridToCRS2D; cornerToCRS2D = gm.cornerToCRS2D; crs2D = createCRS2D(); assert isValid() : this; }
/** Implementation of heuristic constructors. */ private GridGeometry2D( final GridEnvelope gridRange, final Envelope userRange, final boolean[] reverse, final boolean swapXY, final boolean automatic) throws IllegalArgumentException, MismatchedDimensionException { super(gridRange, userRange, reverse, swapXY, automatic); final int[] dimensions; dimensions = new int[4]; gridToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, null); gridFromCRS2D = inverse(gridToCRS2D); gridDimensionX = dimensions[0]; gridDimensionY = dimensions[1]; axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); assert isValid() : this; }
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D();
crs2D = createCRS2D(); assert isValid() : this;
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); if (PixelInCell.CELL_CORNER.equals(anchor)) { cornerToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, hints);
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); if (PixelInCell.CELL_CORNER.equals(anchor)) { cornerToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, hints);
/** * Constructs a new grid geometry identical to the specified one except for the CRS. * Note that this constructor just defines the CRS; it does <strong>not</strong> reproject * the envelope. For this reason, this constructor should not be public. It is for internal * use by {@link GridCoverageFactory} only. */ GridGeometry2D(final GridGeometry2D gm, final CoordinateReferenceSystem crs) { super(gm, crs); gridDimensionX = gm.gridDimensionX; gridDimensionY = gm.gridDimensionY; axisDimensionX = gm.axisDimensionX; axisDimensionY = gm.axisDimensionY; gridFromCRS2D = gm.gridFromCRS2D; gridToCRS2D = gm.gridToCRS2D; crs2D = createCRS2D(); }
/** * Constructs a new grid geometry identical to the specified one except for the CRS. * Note that this constructor just defines the CRS; it does <strong>not</strong> reproject * the envelope. For this reason, this constructor should not be public. It is for internal * use by {@link GridCoverageFactory} only. */ GridGeometry2D(final GridGeometry2D gm, final CoordinateReferenceSystem crs) { super(gm, crs); gridDimensionX = gm.gridDimensionX; gridDimensionY = gm.gridDimensionY; axisDimensionX = gm.axisDimensionX; axisDimensionY = gm.axisDimensionY; gridFromCRS2D = gm.gridFromCRS2D; gridToCRS2D = gm.gridToCRS2D; cornerToCRS2D = gm.cornerToCRS2D; crs2D = createCRS2D(); assert isValid() : this; }
/** * Implementation of heuristic constructors. */ private GridGeometry2D(final GridRange gridRange, final Envelope userRange, final boolean[] reverse, final boolean swapXY, final boolean automatic) throws IllegalArgumentException, MismatchedDimensionException { super(gridRange, userRange, reverse, swapXY, automatic); final int[] dimensions; dimensions = new int[4]; gridToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions); gridFromCRS2D = inverse(gridToCRS2D); gridDimensionX = dimensions[0]; gridDimensionY = dimensions[1]; axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); }
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D();
/** * Implementation of heuristic constructors. */ private GridGeometry2D(final GridEnvelope gridRange, final Envelope userRange, final boolean[] reverse, final boolean swapXY, final boolean automatic) throws IllegalArgumentException, MismatchedDimensionException { super(gridRange, userRange, reverse, swapXY, automatic); final int[] dimensions; dimensions = new int[4]; gridToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, null); gridFromCRS2D = inverse(gridToCRS2D); gridDimensionX = dimensions[0]; gridDimensionY = dimensions[1]; axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); assert isValid() : this; }
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D();
/** * Workaround for RFE #4093999 ("Relax constraint on placement of this()/super() * call in constructors"). */ private GridGeometry2D(final GridEnvelope gridRange, final PixelOrientation anchor, final PixelInCell anchorND, // Computed by caller final MathTransform gridToCRS, final MathTransform2D gridToCRS2D, // Computed by caller final int[] dimensions, // Computed by caller final CoordinateReferenceSystem crs) { super(gridRange, anchorND, PixelTranslation.translate(gridToCRS, anchor, PixelTranslation.getPixelOrientation(anchorND), dimensions[0], dimensions[1]), crs); gridDimensionX = dimensions[0]; gridDimensionY = dimensions[1]; axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; if (gridToCRS == gridToCRS2D) { // Recycles existing instance if we can (common case) this.gridToCRS2D = (MathTransform2D) super.gridToCRS; } else { final int xdim = (gridDimensionX < gridDimensionY) ? 0 : 1; this.gridToCRS2D = (MathTransform2D) PixelTranslation.translate( gridToCRS2D, anchor, PixelOrientation.CENTER, xdim, xdim ^ 1); } gridFromCRS2D = inverse(this.gridToCRS2D); crs2D = createCRS2D(); assert isValid() : this; }
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); if (PixelInCell.CELL_CORNER.equals(anchor)) { cornerToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, hints);
axisDimensionX = dimensions[2]; axisDimensionY = dimensions[3]; crs2D = createCRS2D(); if (PixelInCell.CELL_CORNER.equals(anchor)) { cornerToCRS2D = getMathTransform2D(gridToCRS, gridRange, dimensions, hints);