0

I am trying to perform some scale-tests with some data on GEE. I have the following code where I use the MODIS-NDVI dataset at 500m. What I want to do, is to perform the same analysis but on 25000m x 25000m. Any ideas how to change the pixel size of MODIS-NDVI dataset?

var modisNDVI = ee.ImageCollection ('MODIS/MCD43A4_006_NDVI');
var modiscollection = ee.ImageCollection (modisNDVI.filterDate('2002-03-01','2004-10-31'));

    var chart = ui.Chart.image.doySeriesByYear(
        modiscollection, 'NDVI', region, ee.Reducer.mean(), 500);

    print(chart);

    var clip = modiscollection.mean().clip(region);
    Map.addLayer (clip, {min:0.0,max:1,palette:['FFFFFF','CC9966','CC9900','996600','33CC00','009900','006600','000000']},'NDVI');
1

doySeriesByYear allows you to set a scale parameter which refers to the pixel size in meters. You can change this to your desired pixel size.

var chart_500 = ui.Chart.image.doySeriesByYear({
  imageCollection:modiscollection,
  bandName: 'NDVI',
  region: region,
  regionReducer: ee.Reducer.mean(),
  scale: 500});

print(chart_500);

var chart_25000 = ui.Chart.image.doySeriesByYear({
  imageCollection:modiscollection,
  bandName: 'NDVI',
  region: region,
  regionReducer: ee.Reducer.mean(),
  scale: 25000});

print(chart_25000);
  • Thank you @Kersten. I have a question, probably a basic one. Is this change in pixel size, regards only the DOY? When I import the collection, can I change the pixel size? I am curious, because in other cases, I just want to sample the same collection with points, at different scales. – geo_dd May 18 '18 at 8:03
  • 1
    Inside GEE the data is not transformed until you perform an "export" on it - like creating the chart. In the case you describe you would need to set the scale in the sampling command. There is no need to change the pixel size of the collection - you can change it in the end to whatever you need. – Kersten May 18 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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