Using Landsat Images to calculate NDVI for any country (Sample: India)

Normalized Difference Vegetation Index (NDVI)

The Normalized Difference Vegetation Index (NDVI) is referred to as the continuity index to the existing National Oceanic and Atmospheric Administration-Advanced Very High-Resolution Radiometer (NOAA-AVHRR) derived NDVI.

The NDVI is calculated from these individual measurements as follows:

NDVI= (NIR-Red) \ (NIR+Red)

In this tutorial, we will look at a simple method to calculate NDVI for India (sample area). You can edit the code and calculate NDVI for any country.

NDVI for India

Data used

USGS Landsat 8 Collection 1 Tier 1 and Real-Time data TOA Reflectance

Landsat 8 Collection 1 Tier 1 and Real-Time data calibrated top-of-atmosphere (TOA) reflectance. Calibration coefficients are extracted from the image metadata. See Chander et al. (2009) for details on the TOA computation.

Revisit Interval
16 days

Here is the code:

var countries = ee.FeatureCollection("ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw")
var country_name = ['India']
var Area = countries.filter(ee.Filter.inList('Country', country_name));
Map.addLayer(Area,{},"India");
Map.centerObject(Area, 5);  //Zoom to Study area/

// Import Landsat 8 images
var L8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT_TOA")
var MyCollection = L8.filterBounds(Area)
.filterMetadata('CLOUD_COVER', 'less_than', 1)
.filterDate('2014-01-01','2018-12-31');

var ndviParams = {min: -1, max: 1, palette: ['blue', 'white', 'green']};

function CalculateNDVI(image){
  var selected =image.select('B4','B5');
  var NDVI = selected.expression('(b(1)-b(0))/(b(0)+b(1))').select(['B5'],['NDVI']);
  return NDVI;
}


var NDVIcollection = MyCollection.map(CalculateNDVI);
Map.addLayer(NDVIcollection, ndviParams, 'NDVICollection')

19 thoughts on “Using Landsat Images to calculate NDVI for any country (Sample: India)”

  1. Pingback: Display Natural Color, Color Infrared (Vegetation), Healthy Vegetation, and Vegetation Analysis Maps in a Single Screen using Simple Codes in Google Earth Engine – Study Area (Ethiopia) – DINESH SHRESTHA

  2. Pingback: Add Legends and Title to your Map in GEE – DINESH SHRESTHA

  3. Pingback: Earth Engine App: Take your GEE expertise to next level. – DINESH SHRESTHA

  4. Pingback: Develop a Harmonic Model: Original vs Fitted NDVI values (Study Area: Thailand) – DINESH SHRESTHA

  5. Pingback: Using Hansen Global Forest Change Data to determine Forest Cover, Forest Gain, and Forest Loss (Study Area: Malaysia) – DINESH SHRESTHA

  6. Pingback: Make your map look Artistic – Add Grid Lines in your Map (Study Area: Canada) – DINESH SHRESTHA

  7. Pingback: Night Light Maps (Study Area: South Asia) – DINESH SHRESTHA

  8. Pingback: How to generate Histogram in Google Earth Engine? – DINESH SHRESTHA

  9. Pingback: Using 2001 MODIS Land Cover Type Yearly Global 500m Data to Determine the Land-Cover Analysis (Study Area: Mexico) – DINESH SHRESTHA

  10. Pingback: Learn How to Add two charts next to the map to interactively display a time-series of NDVI and reflectance for each click on the map? – DINESH SHRESTHA

  11. Pingback: Create a Chart to show Landsat 8 TOA Spectra at three points near Mumbai City – DINESH SHRESTHA

  12. Pingback: Learn how to calculate and export 90th Percentile Annual NDVI for years 1985-2019 using Landsat 8, 7, and 5 scenes (Study Area: Turkey) – DINESH SHRESTHA

  13. Pingback: Use 2018 Landsat 8 Scenes for Land Cover Classification in Google Earth Engine (Study Area: Dubai) – DINESH SHRESTHA

  14. Pingback: Land Cover Change Analysis between 1999 and 2018 in GEE (Study Area: Mumbai) – DINESH SHRESTHA

  15. Pingback: Time-lapse: Animate 30m Landsat images generated 90th percentile Annual NDVI from 1999 to 2018 (Study Area: South America) – DINESH SHRESTHA

Leave a Reply

%d bloggers like this: