I would like to calculate a MSI index for the each image of the collection and I developed below presented script. But, somehow it is not working and it says "midir.divade is not a function". Can anyone please assist me in improving the below script?

var image = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
    .filterDate('2015-08-01', '2015-12-31');

var addMSI = function(image) {
  var nir = image.select("B5");
  var midir = image.select("B6");
  var msi = midir.divade(nir);
  return image.addBands(msi);

var withMSI = image.map(addMSI);


You have a typo:

var msi = midir.divade(nir); should be var msi = midir.divide(nir);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.