2

I'm trying to reproject a 500m MODIS image into 0.5° longlat for comparison with climate data. I've followed the instructions for resampling here, but I'm confused about reducing the resolution. I suspect that I'm supposed to change the scale value in reproject(crs, crsTransform, scale), but this value is supposed to be set in meters, which are not consistent across degrees. How can I best convert to a lower resolution in degrees rather than in meters?

What I have so far is:

var modis = ee.ImageCollection("MODIS/006/MCD12Q1").select('LC_Type1');
var region = ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 51.29);


var modisyr = ee.Image(modis.first()).select('LC_Type1');
var modisProjection = modisyr.projection();
var modisResolution = modisyr.projection().nominalScale();
print('MODIS projection:', modisProjection);    
print('MODIS resolution:', modisResolution);    

// Get the forest cover data at MODIS scale and projection.
var modisReproj = modisyr
    // Force the next reprojection to aggregate instead of resampling.
    .reduceResolution({
      reducer: ee.Reducer.mean(),
      maxPixels: 1024
    })
    // Request the data at the scale and projection of the MODIS image.
    .reproject({
      crs: 'EPSG:4326'
    });

var proj2 = modisReproj.projection();
print('MODIS Reprojection:', proj2);
var modisResolution2 = modisyr.projection().nominalScale();
print('MODIS resolution:', modisResolution2);

Your Answer

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

Browse other questions tagged or ask your own question.