-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIGBP_LULC.js
More file actions
28 lines (22 loc) · 998 Bytes
/
Copy pathIGBP_LULC.js
File metadata and controls
28 lines (22 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var aoi = ee.Geometry.Rectangle([82.95872867001023, 26.44836312809755, 83.77995669735398, 26.983196569043436])
Map.centerObject(aoi)
Map.addLayer(aoi)
var lc = ee.ImageCollection("MODIS/061/MCD12Q1")
.select('LC_Type1')
//.filterDate('2023-01-01','2023-12-31').first().clip(aoi)
.map(function(lc) {return lc.clip(aoi)})
var years =lc.toList(lc.size()) //image List or just by ee.List.sequence(2001, EndingYear)
.map(function(img) { var year = ee.Date(ee.Image(img).get('system:time_start')).get('year'); return year; });
var bands = years.map(function(y) { return ee.String('LC_').cat(ee.Number(y).int().format())})
var ic = lc.toBands().rename(bands)
print(ic)
Map.addLayer(ic)
Export.image.toDrive({
image: ic,
description: 'MODIS_LandCover_IGBP',
folder: 'Earth engine',
fileNamePrefix: 'LandCover_AOI',
region: aoi, scale: 500,
crs: 'EPSG:4326'})
//https://lpdaac.usgs.gov/documents/1409/MCD12_User_Guide_V61.pdf ; page no 9
// CItation https://doi.org/10.5067/MODIS/MCD12Q1.061