Select Feature in GEE – How to Select a Feature in Google Earth Engine (MODIS)

google-earth-engine

I am looking at a landcover map from MODIS:

var dataset = ee.ImageCollection('MODIS/006/MOD44B');

var visualization = {
  bands: ['Percent_Tree_Cover'],
  min: 0.0,
  max: 100.0,
  palette: ['bbe029', '0a9501', '074b03']
};

Map.addLayer(dataset, visualization, 'Percent Tree Cover');

print(dataset);

This shows a map, but I am interested in individual years:

enter image description here

How can I select feature 0 (2000_03_05) or any of the other features (2001_03_05, 2002_03_05, etc) ?
I can't get it to work with feature selection.

Best Answer

You do that by filtering your image collection. Then you might want to turn your collection into a single image by reducing it. Like this, for instance:

var image = ee.ImageCollection('MODIS/006/MOD44B')
  .filterDate('2000-03-05', '2000-03-06') // Filter down to a single day
  .first() // Take the first image in the collection

var visualization = {
  bands: ['Percent_Tree_Cover'],
  min: 0.0,
  max: 100.0,
  palette: ['bbe029', '0a9501', '074b03']
};

Map.addLayer(image, visualization, 'Percent Tree Cover');

print(image);

https://code.earthengine.google.com/1517b9af7389396bdcc0b6a34aee6a87

Related Question