code: public static GeneralParameterValue[] createGridGeometryGeneralParameter( int width, int height, double north, double south,
              double east, double west, CoordinateReferenceSystem crs ) {
          GeneralParameterValue[] readParams = new GeneralParameterValue[1];
          Parameter<GridGeometry2D> readGG = new Parameter<GridGeometry2D>(AbstractGridFormat.READ_GRIDGEOMETRY2D);
          GridEnvelope2D gridEnvelope = new GridEnvelope2D(0, 0, width, height);
          Envelope env;
          if (crs != null) {
              env = new ReferencedEnvelope(west, east, south, north, crs);
          } else {
              DirectPosition2D minDp = new DirectPosition2D(west, south);
              DirectPosition2D maxDp = new DirectPosition2D(east, north);
              env = new Envelope2D(minDp, maxDp);
          }
          GridGeometry2D gridGeometry = new GridGeometry2D(gridEnvelope, env);
          readGG.setValue(gridGeometry);
          readParams[0] = readGG;
  
          return readParams;
      }
docs: Utility method to create read parameters for {@link GridCoverageReader}
  
  @param width the needed number of columns.
  @param height the needed number of columns.
  @param north the northern boundary.
  @param south the southern boundary.
  @param east the eastern boundary.
  @param west the western boundary.
  @param crs the {@link CoordinateReferenceSystem}. Can be null, even if it should not.
  @return the {@link GeneralParameterValue array of parameters}.