0

As everyone knows GLDAS data in Google Earth Engine has 25 kilometers spatial resolution. Accordingly I called these data in code editor in order to change the pixel size from 25000m to 250m. I tested many resampling techniques but didn't work. Could anyone guide me please?

code link: https://code.earthengine.google.com/0ae03a390790053c17b717f84dc45637

Map.centerObject(table);
Map.addLayer(table);


var GLDAS24 = ee.ImageCollection("NASA/GLDAS/V021/NOAH/G025/T3H")
.filterDate('2020-11-01','2020-11-02')
.filterBounds(table)
.mean().clip(table)
.select('Albedo_inst');

// resampling

var modis = ee.Image(ee.ImageCollection('MODIS/006/MOD13A1').first())
    .select('EVI');
    
 var modisProjection = modis.projection();
    

var projection = GLDAS24.setDefaultProjection({
  crs: modisProjection,
  scale: 250
})

print(projection)

var GLDAS250 = projection
    .reduceResolution({
      reducer: ee.Reducer.mean(),
      maxPixels: 1024
    })
    .reproject({
      crs: modisProjection
    });

Map.addLayer(GLDAS250,[],'GLDAS250',false)
1
  • 1
    What do you mean by "it didn't work" ? Is it that you don't see anything on the map ? Is the size of the pixels that seems the same ? do you get an error ? Jun 25, 2021 at 10:47

1 Answer 1

0

ReduceResolution is for aggregating pixels together, and setDefaultProjection only works on things that don't already have a projection (like composites).

You probably want resample(), followed by a reproject().

var result = GLDAS24.resample().reproject(modisProjection.atScale(250))

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.