0

I am currently trying to explore the MODIS Land Cover Dynamics dataset using Google Earth Engine. However, when I runned the snippet proposed on the GEE page, i.e.:

var dataset = ee.ImageCollection('MODIS/MCD12Q2')
                  .filter(ee.Filter.date('2014-01-01', '2014-05-01'));
var vegetationMaturity2014 = dataset.select('Onset_Greenness_Maximum1');
var vegetationMaturity2014Vis = {
  min: 0.0,
  max: 32766.0,
  palette: ['0f17ff', 'b11406', 'f1ff23'],
};
Map.setCenter(6.746, 46.529, 2);
Map.addLayer(
    vegetationMaturity2014, vegetationMaturity2014Vis,
    'Vegetation Maturity 2014');

the output does not match the preview on the GEE page. In fact, what I am assuming to be a color scale instead appears as a single color. I have tried changing the dates, the max vis value, the band selected, yet none of these actions has any incidence on the fact that the map is a single color. Is the dataset faulty? Am I doing something wrong?

1 Answer 1

2

Ok I fixed it! Turns out the default min and max are waaay off, if you don't set the min to 5100 and the max to 5400 you're likely not to see anything:

var dataset = ee.ImageCollection('MODIS/MCD12Q2')
                  .filter(ee.Filter.date('2014-01-01', '2014-05-01'));
var vegetationMaturity2014 = dataset.select('Onset_Greenness_Maximum1');
var vegetationMaturity2014Vis = {
  min: 5100.0,
  max: 5400.0,
  palette: ['0f17ff', 'b11406', 'f1ff23'],
};
Map.setCenter(6.746, 46.529, 2);
Map.addLayer(
    vegetationMaturity2014, vegetationMaturity2014Vis,
    'Vegetation Maturity 2014');

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.