Link Search Menu Expand Document

Tutorial 4

Compose and mosaic images

//Create a variable that points to a particular Landsat image in the Earth Engine collection.  
var image1 = ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_19880619');
var image2 = ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_20100531');

// Mosaic above two images
var mosaic = ee.ImageCollection([
image1,
image2
]);

// Compose image mosaic to display maximum values only
var composite = mosaic.max();

// Center the map and display the image.
Map.setCenter(-76.147, 43.046, 10); // Center on City of Syracuse using level 10 scale

// Display mosaic, composite image and individual images
Map.addLayer(image1, {bands:['B5', 'B4', 'B3']}, 'image1',false);
Map.addLayer(image2, {bands:['B5', 'B4', 'B3']}, 'image2',false);
Map.addLayer(mosaic, {bands:['B5', 'B4', 'B3']}, 'mosaic image',false);
Map.addLayer(composite, {bands:['B5', 'B4', 'B3']}, 'composite image',false);

// Examine mosaic and composite attribures
print(mosaic);
print(composite);