Watch the refugee camp in Bangladesh evolve using Sentinel-2

Use the code below or click here.


// set geometry
var aoi = ee.Geometry.Polygon([[92.10079193115234,21.231782183740147],
[92.09976196289062,21.14214965677984],
[92.19245910644531,21.14118901416337],
[92.19245910644531,21.237542414259934],
[92.10044860839844,21.238182425982313],
[92.10079193115234,21.231782183740147]]);

// get images
var img2015 = ee.Image("COPERNICUS/S2/20151206T042142_20170519T010750_T46QDJ");
var img2017 = ee.Image("COPERNICUS/S2/20171230T042149_20171230T042930_T46QDJ");

// calculate NDVI
var ndvi2015 = img2015.normalizedDifference(["B8","B4"]);
var ndvi2017 = img2017.normalizedDifference(["B8","B4"]);

// add image to map
Map.addLayer(img2015.clip(aoi),{min:0,max:3000,bands:"B4,B3,B2"},"sentinel 2 2015");
Map.addLayer(img2017.clip(aoi),{min:0,max:3000,bands:"B4,B3,B2"},"sentinel 2 2017");

// add ndvi to map
Map.addLayer(ndvi2015.clip(aoi),{min:0,max:1,palette:"red,yellow,green,darkgreen"},"ndvi 2015");
Map.addLayer(ndvi2017.clip(aoi),{min:0,max:1,palette:"red,yellow,green,darkgreen"},"ndvi 2017");

 

Advertisements