How to Visualize and Learn about Image Metadata

There are a lot of tutorials in Google Earth Engine User Guide page on how to visualize and learn about image and metadata. I have collected some important ways to extract useful information from images.

// Load an image.
var image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318');
// Define the visualization parameters.
var vizParams = {
  bands: ['B5', 'B4', 'B3'],
  min: 0,
  max: 0.5,
  gamma: [0.95, 1.1, 1]

// Center the map and display the image.
Map.setCenter(-122.1899, 37.5010, 10); // San Francisco Bay
Map.addLayer(image, vizParams, 'false color composite');

// Get information about the bands as a list.
var bandNames = image.bandNames();
print('Band names: ', bandNames); // ee.List of band names

// Get projection information from band 1.
var b1proj ='B1').projection();
print('Band 1 projection: ', b1proj); // ee.Projection object

// Get scale (in meters) information from band 1.
var b1scale ='B1').projection().nominalScale();
print('Band 1 scale: ', b1scale); // ee.Number

// Note that different bands can have different projections and scale.
var b8scale ='B8').projection().nominalScale();
print('Band 8 scale: ', b8scale); // ee.Number

// Get a list of all metadata properties.
var properties = image.propertyNames();
print('Metadata properties: ', properties); // ee.List of metadata properties

// Get a specific metadata property.
var cloudiness = image.get('CLOUD_COVER');
print('CLOUD_COVER: ', cloudiness); // ee.Number

// Get the timestamp and convert it to a date.
var date = ee.Date(image.get('system:time_start'));
print('Timestamp: ', date); // ee.Date

Back to Google Earth Engine Home-Page

Leave a Reply

%d bloggers like this: