getDouble method

  1. @override
double getDouble(
  1. int col,
  2. int row, [
  3. int? band
])
override

Get the raster value as double at a given position and (optional) band.

Implementation

@override
double getDouble(int col, int row, [int? band]) {
  if (isEsriAsc) {
    return dataList[row][col].toDouble();
  } else {
    if (_raster == null) {
      throw StateError("raster is null");
    }
    if (band == null || band == 0) {
      return _raster!.data!.getPixel(col, row).r.toDouble();
    } else if (band == 1) {
      return _raster!.data!.getPixel(col, row).g.toDouble();
    } else if (band == 2) {
      return _raster!.data!.getPixel(col, row).b.toDouble();
    }
    throw StateError("invalid band number");
  }
}