1

I would like to perform mapping paddy rice with the Google Earth Engine for large scale. I came across with an article which proposed method for mapping paddy rice with special index related to phenological characteristics of paddy rice. Here is link for research paper www.mdpi.com/2072-4292/10/3/447/s1.

According to this article they calculated PMI (Paddy rice Mapping Index) in two crop season, transplantin/seeding and harvest period. Based on this algorithm paddy rice is identified with more than 0.2 thereshold. enter image description here

Thus, my goal is develop this algorithm in the Google earth engine Platform. I am going to this Multispectral Images such as Landsat and Sentinel-2. Here I wrote some codes but I recieved some error. enter image description here

Please see my code below,

Map.centerObject(roi);

var spring = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
                          .filterDate('2020-05-20','2020-06-15')
                          .filterBounds(roi)
                          .map(function(image){return image.clip(roi)});

var harvest = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
                          .filterDate('2020-09-10','2020-09-30')
                          .filterBounds(roi)
                          .map(function(image){return image.clip(roi)});

/// PMI Identification

var spring_NIR = spring.select('B5')
var harvest_NIR = harvest.select('B5')

var numerator = harvest_NIR.subtract(spring_NIR);
var denominator = harvest_NIR.add(spring_NIR);
var PMI = numerator.divide(denominator);


var colors = ['white','yellow'];
Map.addLayer(PMI, {palette: colors}, 'Colored PMI');

Code link https://code.earthengine.google.com/2f096e88a9babe58c1e790d64af50642

1
  • I can't see your ROI, but I can infer the problem is that you are working with image collections. Both spring_NIR and harvest_NIR are image collections (you can check it out by print), if they were images the code would work fine. Do you really need to work with collections?
    – HMSP
    Commented Mar 30, 2021 at 7:41

1 Answer 1

1

It is not possible to add/subtract Image Collections from each other. It is only possible to add/subtract single Images.

The solution would be to reduce down the Image Collection to single images. For example by using .mean() or .first():

var spring = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
                          .filterDate('2020-05-20','2020-06-15')
                          .filterBounds(roi)
                          .map(function(image){return image.clip(roi)})
                          .first();

var harvest = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
                          .filterDate('2020-09-10','2020-09-30')
                          .filterBounds(roi)
                          .map(function(image){return image.clip(roi)})
                          .first();

/// PMI Identification

var spring_NIR = spring.select('B5')
var harvest_NIR = harvest.select('B5')

var numerator = harvest_NIR.subtract(spring_NIR);
var denominator = harvest_NIR.add(spring_NIR);
var PMI = numerator.divide(denominator);
1
  • Thank you so much for clarification. Commented Mar 30, 2021 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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