Modis short code gee for all country to assess ndvi var clipToCol = function(image) { return image clip(roi); }; function


Download 17.11 Kb.
Sana30.04.2023
Hajmi17.11 Kb.
#1402423
Bog'liq
code GEE


MODIS_SHORT _CODE_GEE FOR ALL COUNTRY TO ASSESS NDVI

var clipToCol = function(image) { return image.clip(roi); };
function addnd(input) {
var nd = input.normalizedDifference(['sur_refl_b02', 'sur_refl_b01']).rename('ndvi');
return input.addBands (nd); }
var collection = ee.ImageCollection("MODIS/006/MOD09GQ") .filterDate('2020-02-25','2020-06-20')
.map(clipToCol) .map(addnd)
var maskQA = function(image) { return image.updateMask(image.select("QA").eq(0)); };
var ndvi = collection.select("ndvi")
var ndvits =ndvi.toBands()

Map.centerObject(roi)


Map.addLayer(ndvi)
SENTINEL_SHORT _CODE_GEE FOR ALL COUNTRY TO ASSESS NDVI
var data = sentinel.filterBounds(roi).filterDate('2022-03-28','2022-05-01').median()

var RED = data.select('B4')
var NIR = data.select('B8')

var NDVI = NIR.subtract(RED).divide(NIR.add(RED))
var NDVIc = NDVI.clip(roi)

Map.centerObject(roi,8)


Map.addLayer(NDVIc)

LANDSAT_SHORT_CODE_GEE FOR ALL COUNTRY TO ASSESS NDVI
var ls8 = ee.ImageCollection('LANDSAT/LS08/LS02/T1_T2')
.filterDate('2022-03-07', '2022-05-31')
.filterBounds(roi) .select('SR_B4', 'SR_B5') .filter(ee.Filter.lt('CLOUD_COVER', 10));
Map.centerObject(roi, 9);
print(ls8, 'landsat')
var ls8_median = ls8.median() .clip(roi);
var nir = ls8_median.select('SR_B5');
var red = ls8_median.select('SR_B4');
var NDVI = nir.subtract(red).divide(nir.add(red)).rename('NDVI');
print(ndvi,'NDVI_UZBEKISTAN Aprel 2022');

var sviParams = ['colorized'];

Map.addLayer(ndvi, sviParams, 'SVI Uzbekistan July 2020');
Download 17.11 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling