parameters: (band, array, xoff=0, yoff=0,
                     resample_alg=gdal.GRIORA_NearestNeighbour,
                     callback=None, callback_data=None)
return_statement: return ret
docstring: Pure python implementation of writing a chunk of a GDAL file
      from a numpy array.  Used by the gdal.Band.WriteArray method.
docstring_summary: Pure python implementation of writing a chunk of a GDAL file
      from a numpy array.  Used by the gdal.Band.WriteArray method.
docstring_tokens: Pure python implementation of writing a chunk of a GDAL file from a numpy array . Used by the gdal . Band . WriteArray method .
function: def BandWriteArray(band, array, xoff=0, yoff=0,
                     resample_alg=gdal.GRIORA_NearestNeighbour,
                     callback=None, callback_data=None):
      """Pure python implementation of writing a chunk of a GDAL file
      from a numpy array.  Used by the gdal.Band.WriteArray method."""
  
      if array is None or len(array.shape) != 2:
          raise ValueError("expected array of dim 2")
  
      xsize = array.shape[1]
      ysize = array.shape[0]
  
      if xsize + xoff > band.XSize or ysize + yoff > band.YSize:
          raise ValueError("array larger than output file, or offset off edge")
  
      datatype = NumericTypeCodeToGDALTypeCode(array.dtype.type)
  
  # if we receive some odd type, like int64, try casting to a very
  # generic type we do support (#2285)
      if not datatype:
          gdal.Debug('gdal_array', 'force array to float64')
          array = array.astype(numpy.float64)
          datatype = NumericTypeCodeToGDALTypeCode(array.dtype.type)
  
      if not datatype:
          raise ValueError("array does not have corresponding GDAL data type")
  
      ret = BandRasterIONumPy(band, 1, xoff, yoff, xsize, ysize,
                               array, datatype, resample_alg, callback, callback_data)
      if ret != 0:
          _RaiseException()
      return ret
function_tokens: def BandWriteArray ( band , array , xoff = 0 , yoff = 0 , resample_alg = gdal . GRIORA_NearestNeighbour , callback = None , callback_data = None ) : if array is None or len ( array . shape ) != 2 : raise ValueError ( "expected array of dim 2" ) xsize = array . shape [ 1 ] ysize = array . shape [ 0 ] if xsize + xoff > band . XSize or ysize + yoff > band . YSize : raise ValueError ( "array larger than output file, or offset off edge" ) datatype = NumericTypeCodeToGDALTypeCode ( array . dtype . type ) # if we receive some odd type, like int64, try casting to a very # generic type we do support (#2285) if not datatype : gdal . Debug ( 'gdal_array' , 'force array to float64' ) array = array . astype ( numpy . float64 ) datatype = NumericTypeCodeToGDALTypeCode ( array . dtype . type ) if not datatype : raise ValueError ( "array does not have corresponding GDAL data type" ) ret = BandRasterIONumPy ( band , 1 , xoff , yoff , xsize , ysize , array , datatype , resample_alg , callback , callback_data ) if ret != 0 : _RaiseException ( ) return ret