// Create a variable that points to a particular Landsat image in the Earth Engine collection. varmyimage=ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_20100531');// Center the map and display the image.Map.setCenter(-76.147,43.046,10);// Center on City of Syracuse using level 10 scaleMap.addLayer(myimage);//Display the image using a specific band combination and call the image ColorIR composite.//Possible band combinations: http://web.pdx.edu/~nauna/resources/10_BandCombinations.htmMap.addLayer(myimage,{bands:['B4','B3','B2']},'ColorIRcomposite',false);Map.addLayer({visParams:{bands:['B4','B3','B2']},eeObject:myimage,name:'ColorIRcomposite2'},false);Map.addLayer({visParams:{bands:['B1','B4','B7']},eeObject:myimage,name:'Urbancomposite'},false);Map.addLayer({visParams:{bands:['B3','B2','B1']},eeObject:myimage,name:'Naturalcomposite'},false);// Define visualization parameters to display the image in the map window.varvizParams={bands:['B4','B3','B2'],min:0,max:0.5,gamma:[0.95,1.1,1]};Map.addLayer(myimage,vizParams,'ColorIRcomposite',false);// Create a circle by drawing a 2000 meter buffer around a point and saving this to variable roi.varroi=ee.Geometry.Point([-76.147,43.046]).buffer(20000);// Display the 2000meter buffer.Map.addLayer(roi);
Performing image band calculations
/* Create a function to compute NDVI from Landsat 5 imagery where B4 is the NIR band and B3 is the red band. */vargetNDVI=function(image){returnimage.normalizedDifference(['B4','B3']);};// Load two Landsat 5 images, 20 years apart.varimage1=ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_19880619');varimage2=ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_20100531');// Display NDVIMap.addLayer(image1,{bands:['B3','B2','B1']},"1st image");Map.addLayer(image2,{bands:['B3','B2','B1']},"2nd image");// Compute NDVI from the scenes.varndvi1=getNDVI(image1);varndvi2=getNDVI(image2);// Display NDVIMap.addLayer(ndvi1,{},"1st image NDVI");Map.addLayer(ndvi2,{},"2nd image NDVI");// Compute the difference in NDVI.varndviDifference=ndvi2.subtract(ndvi1);Map.addLayer(ndviDifference,{},"NDVI difference");
Image metadata
// // Create a variable that points to a particular Landsat image in the Earth Engine collection. // var myimage = ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_20100531');// print(myimage);