code: private void fixRowsAndCols() {
          rows = (int) Math.round((north - south) / ns_res);
          if (rows < 1)
              rows = 1;
          cols = (int) Math.round((east - west) / we_res);
          if (cols < 1)
              cols = 1;
      }
docs: calculates rows and cols from the region and its resolution.
  
  <p>
  Rows and cols have to be integers, rounding is applied if required.
  </p>