code: @Execute
      public void process() throws Exception {
          if (!concatOr(outPit == null, doReset)) {
              return;
          }
          checkNull(inElev);
          HashMap<String, Double> regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inElev);
          nCols = regionMap.get(CoverageUtilities.COLS).intValue();
          nRows = regionMap.get(CoverageUtilities.ROWS).intValue();
          xRes = regionMap.get(CoverageUtilities.XRES);
          yRes = regionMap.get(CoverageUtilities.YRES);
  
          elevationIter = CoverageUtilities.getRandomIterator(inElev);
  
          // output raster
          WritableRaster pitRaster = CoverageUtilities.createWritableRaster(nCols, nRows, null, null, null);
          pitIter = CoverageUtilities.getWritableRandomIterator(pitRaster);
  
          for( int i = 0; i < nRows; i++ ) {
              if (pm.isCanceled()) {
                  return;
              }
              for( int j = 0; j < nCols; j++ ) {
                  double value = elevationIter.getSampleDouble(j, i, 0);
                  if (!isNovalue(value)) {
                      pitIter.setSample(j, i, 0, value);
                  } else {
                      pitIter.setSample(j, i, 0, PITNOVALUE);
                  }
              }
          }
  
          flood();
          if (pm.isCanceled()) {
              return;
          }
  
          for( int i = 0; i < nRows; i++ ) {
              if (pm.isCanceled()) {
                  return;
              }
              for( int j = 0; j < nCols; j++ ) {
                  if (dir[j][i] == 0) {
                      return;
                  }
                  double value = pitIter.getSampleDouble(j, i, 0);
                  if (value == PITNOVALUE || isNovalue(value)) {
                      pitIter.setSample(j, i, 0, doubleNovalue);
                  }
              }
          }
          pitIter.done();
  
          outPit = CoverageUtilities.buildCoverage("pitfiller", pitRaster, regionMap, inElev.getCoordinateReferenceSystem());
      }
docs: The pitfiller algorithm.
  
  @throws Exception