GeoRaster.ascToWrite constructor

GeoRaster.ascToWrite(
  1. int cols,
  2. int rows,
  3. double res,
  4. double xLLCorner,
  5. double yLLCorner, {
  6. double? defaultValue,
  7. double? novalue,
  8. String? prjWkt,
})

Create a georaster in esrii asc format to write.

This will create the internal memory structure to be filled with the setDouble and setInt methods and then be written to disk with teh write method.

Implementation

GeoRaster.ascToWrite(
    int cols, int rows, double res, double xLLCorner, double yLLCorner,
    {double? defaultValue, double? novalue, String? prjWkt}) {
  if (novalue == null) {
    novalue = -9999.0;
  }
  dataList = []; // List(rows);
  for (var i = 0; i < rows; i++) {
    if (defaultValue != null) {
      dataList.add(List.filled(cols, defaultValue));
      // dataList[i] = List.filled(cols, defaultValue);
    } else {
      dataList.add(List.filled(cols, 0.0));
      // dataList[i] = List(cols);
    }
  }
  writeMode = true;
  isEsriAsc = true;
  _geoInfo = GeoInfo.fromValues(
      cols, rows, res, -res, xLLCorner, yLLCorner + res * rows, prjWkt);
  _geoInfo!.noValue = novalue;
}