I'm going to join Landsat-8 and MODIS image collections using the below code but returns nothing. Does anyone know about this?
code link: https://code.earthengine.google.com/2504c97ec795f4f458f7966795110846
Map.centerObject(geometry);
var landsatNDWI = function(img){
var bands = img.select('SR_B[1-7]').multiply(2.75e-05).add(-0.2);
var index = bands.normalizedDifference(['SR_B3','SR_B5']).rename('ndwi');
return index
.copyProperties(img,['system:time_start','system:time_end']);
};
var modisNDWI = function(img){
var bands = img.select('sur_refl_b0[1-7]').multiply(0.0001);
var index = bands.normalizedDifference(['sur_refl_b04','sur_refl_b02']).rename('ndwi');
return index
.copyProperties(img,['system:time_start','system:time_end']);
};
var landsat = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
.filterDate('2018','2020')
.filterBounds(geometry)
.map(landsatNDWI);
var modis = ee.ImageCollection("MODIS/006/MOD09GA")
.filterDate('2018','2020')
.filterBounds(geometry)
.map(modisNDWI);
var filter = ee.Filter.equals({
leftField: 'system:time_start',
rightField: 'system:time_start'
});
// Create the join.
var simpleJoin = ee.Join.inner();
// Inner join
var innerJoin = ee.ImageCollection(simpleJoin.apply(landsat, modis, filter));
var joined = innerJoin.map(function(feature) {
return ee.Image.cat(feature.get('primary'), feature.get('secondary'));
});
print('Joined', joined);