I'm studying GEE for a project, and I want to clip from a polygon in MODIS. How to I do this?

I use the MODIS MOD10A1.006 Terra Snow Cover Daily Global 500m. I also use filterbounds instead of clip, but its not working and shows me the whole extent.


// Create variables for 2000 summer period
var summer_2020 = ee.Filter.date('2020-06-01','2020-09-30');
var summer_2021 = ee.Filter.date('2021-06-01','2021-09-30');
var summer_2022 = ee.Filter.date('2022-06-01','2022-09-30');

// Create the intergrated date filter: 2000
var summerFilter_2020 = ee.Filter.or(summer_2020, summer_2021, summer_2022);
var dataset = ee.ImageCollection("MODIS/006/MOD10A1")
var image_MD_2020 = dataset.mean().clip(geometry);
var snowCover = dataset.select('NDSI_Snow_Cover');
var snowCoverVis = {
  min: 0.0,
  max: 100.0,
  palette: ['black', '0dffff', '0524ff', 'ffffff'],
Map.setCenter(-41.13, 76.35, 2);
Map.addLayer(snowCover, snowCoverVis, 'Snow Cover');

1 Answer 1


You cannot clip an image collection in GEE. You first need to reduce it to an image which you can then clip, so:

var snowCover = dataset.select('NDSI_Snow_Cover');

Should be, for example,

var snowCover = dataset.select('NDSI_Snow_Cover').mean().clip(geometry);

Your Answer

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

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