Skip to content

Instantly share code, notes, and snippets.

@mahdin75
Last active May 19, 2024 17:43
Show Gist options
  • Save mahdin75/7bc4e25110e02aa301427f8b081fddc0 to your computer and use it in GitHub Desktop.
Save mahdin75/7bc4e25110e02aa301427f8b081fddc0 to your computer and use it in GitHub Desktop.
Download NDVI - MODIS
//google earth engine (GEE) modis - ndvi downlod
var us_extent = ... // create a geometry for the extent of your study area (such as the US). You can draw a rectangle in GEE.
function clp(img) {
return img.clip(us_extent)
}
var dataset = ee.ImageCollection('MODIS/061/MOD13A3').filter(ee.Filter.date('2000-01-01', '2021-01-01'));
var clippedVIIRS = dataset.map(clp);
var ndvi = clippedVIIRS.select('NDVI').mean();
var projection = ndvi.projection().getInfo();
Map.addLayer(ndvi, { min: 0, max: 9000}, 'NDVI');
Export.image.toDrive({
image: ndvi,
folder:'ndvis_us_2000_to_2020',
description: '2020',
crs: projection.crs,
region:us_extent,
scale:1000
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment