cdm/src/main/java/ucar/nc2/geotiff/GeotiffWriter.java
private ArrayFloat replaceMissingValues(IsMissingEvaluator grid, Array data, MAMath.MinMax dataMinMax) {
    float minValue = (float) (dataMinMax.min - 1.0);

    ArrayFloat floatArray = (ArrayFloat) Array.factory(DataType.FLOAT, data.getShape());
    IndexIterator dataIter = data.getIndexIterator();
    IndexIterator floatIter = floatArray.getIndexIterator();
    while (dataIter.hasNext()) {
      float v = dataIter.getFloatNext();
      if (grid.isMissing((double) v)) {
        v = minValue;
      }
      floatIter.setFloatNext(v);
    }

    return floatArray;
  }
private ArrayFloat replaceMissingValues(IsMissingEvaluator grid, Array data, MAMath.MinMax dataMinMax) {
    float minValue = (float) (dataMinMax.min - 1.0);

    ArrayFloat floatArray = (ArrayFloat) Array.factory(DataType.FLOAT, data.getShape());
    IndexIterator dataIter = data.getIndexIterator();
    IndexIterator floatIter = floatArray.getIndexIterator();
    while (dataIter.hasNext()) {
      float v = dataIter.getFloatNext();
      if (grid.isMissing((double) v)) {
        v = minValue;
      }
      floatIter.setFloatNext(v);
    }

    return floatArray;
  }
private ArrayFloat replaceMissingValues ( IsMissingEvaluator grid , Array data , MAMath . MinMax dataMinMax ) { float minValue = ( float ) ( dataMinMax . min - 1.0 ) ; ArrayFloat floatArray = ( ArrayFloat ) Array . factory ( DataType . FLOAT , data . getShape ( ) ) ; IndexIterator dataIter = data . getIndexIterator ( ) ; IndexIterator floatIter = floatArray . getIndexIterator ( ) ; while ( dataIter . hasNext ( ) ) { float v = dataIter . getFloatNext ( ) ; if ( grid . isMissing ( ( double ) v ) ) { v = minValue ; } floatIter . setFloatNext ( v ) ; } return floatArray ; }
Replace missing values with dataMinMax.min - 1.0; return a floating point data array.

@param grid GridDatatype
@param data input data array
@return floating point data array with missing values replaced.
Replace missing values with dataMinMax . min - 1 . 0 ; return a floating point data array .