This is a simple operation I've done with other data sets on GEE but for some reason I can't get it to work with MODIS AOD.

Working off the example on Google's developer website...

var collection = ee.ImageCollection('MODIS/006/MCD19A2_GRANULES')
              .filterDate('2019-01-01', '2019-01-15');
var band_viz = {
  min: 0,
  max: 500,
  palette: ['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']

Map.addLayer(collection.mean(), band_viz, 'Optical Depth 047');
Map.setCenter(76, 13, 6);

We get a raster of mean AOD values

enter image description here

Next I want to plot the first raster from the collection.

var image = collection.first()
Map.addLayer(image, band_viz, 'Optical Depth 047');

enter image description here

The image appears in the console and in the map legend, but is not visible on the map.

Here's the link to the script. Thanks!

1 Answer 1


That first image just happens to have all pixels in the Optical_Depth_047 band masked. I modified your script, including all bands, added the geometry of the image to the map, and centered the map to the image. Go to the Inspector tab on the right-hand-side panel in the Code Editor and click within the image geometry. This gives you an idea of how the image looks at the location you clicked.

var collection = ee.ImageCollection('MODIS/006/MCD19A2_GRANULES')
  .filterDate('2019-01-01', '2019-01-15')

var image = collection.first()
Map.addLayer(image.geometry(), null, 'geometry')
Map.addLayer(image, null, 'image')


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.