Google Earth Engine: Normalized Difference Vegetation Index Training Release 2.0.0
International Research Institute for Climate and Society, Earth Institute, Columbia University
Pietro Ceccato Valerie Pietsch
Yung-Jen Chen Benjamin Marconi Carolyn Balk Alice Stevenson
1
May 24, 2017
2
3
CONTENTS
1.1 Definition 1.2 Interpretation 1.3 Access 1.4 Analyses 1.5 Case Study – Brazil 1.6 Validation of NDVI Data 1.7 Summary 1.8 References
1 5 5 5 7 8 11 11
4
Google Earth Engine: MODIS Normalized Difference Vegetation Index (NDVI) Training MODIS Normalized Difference Vegetation Index (NDVI) The Moderate Resolution Imaging Spectroradiometer (MODIS) is an instrument carried by NASA’s Aqua and Terra satellites. It captures images of Earth’s surface in 1-2 day intervals in 36 spectral bands. The spatial resolution is 1000m, and the data extends from March 5, 2000 to the present. MODIS images can be used to analyze land surface changes over time, including vegetation changes as calculated through the normalized difference vegetation index (NDVI). The MODIS Combined 16-day NDVI computes this index from the near-infrared (NIR) and red bands of each scene as NN IR−Red , ranging in value from -1.0 to 1.0 and using the MCD43A4 IR+Red MODIS surface reflectance composites as inputs. Why was it developed? This Google Earth Engine map displays global NDVI over a user-input 1-year period. The tool also provides NDVI long-term and short-term time series for a user-specified region over user-specified time periods. What is the tool used for? The tool is used for analysis of global vegetation trends, with possible applications to climate change, agriculture, water resources, etc. What can the current tool not be used for? The Terra and Aqua satellites were launched in 1999 and 2002, respectively. Therefore, the tool can only be used for analyzing NDVI data from March 5, 2000 to the present, with about a month delay between satellite imaging and availability of data. It cannot be used for future NDVI projections.
1.1 Definition The Google Earth Engine – MODIS NDVI tool can be modified to output a time-series of NDVI values for a user-defined region. This region can be defined through use of the geometry tool shown in the image below.
5
The region is imported into the map through the following code: // Import region var region = geometry;
Alternatively, a region can be selected using Google Fusion Tables. Specific countries can be accessed from the ‘Countries.csv’ Google Fusion Table available publicly at: https://www.google.com/fusiontables/data?docid=1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw -1d9omPw#rows:id=1. The code below selects Brazil from this file. Other data layers can be uploaded to Google Fusion Tables and accessed similarly, or public tables can be searched at: https://research.google.com/tables. //Choose country using GEE Feature Collection var region = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw') .filter(ee.Filter.eq('Country', 'Brazil'));
This layer is then added to the map, showing the outline of the country. //Add region outline to layer - for selected countries Map.addLayer(region,{}, 'Brazil')
Following this region selection, the MODIS NDVI image collections are uploaded into Google Earth Engine (GEE), as follows: 6
// Collect data and filter by total dates var modisNDVI = ee.ImageCollection('MODIS/MCD43A4_NDVI');
The imported MODIS NDVI data // Collect data and filter by total dates
The Google Earth Engine – MODIS NDVI tool provides a map of very short-term (1 month) average NDVI, a time series of long-term (16-year) average NDVI, and a time series of short-term (1-year) average NDVI. These long and two short-term periods can be input by the user for a desired analysis period by manipulating the code below, where collection05 is the long-term period, collection01 is the short-term period, and collection00 is mapped. // Select dates var collection05 = ee.ImageCollection(modNDVI.filterDate('2002-01-01', '2004-12-31')); var collection01 = e e.ImageCollection(modNDVI.filterDate('2008-01-01', '2008-12-31'));
Finally, the MODIS NDVI data sets are “clipped” to the user-specified region. //Clip to Specified Region var clipped05 = collection05.mean().clip(region) var clipped01 = collection01.mean().clip(region)
The NDVI time series are then charted and display in the GEE Console. In this case, all of Brazil is too large a region for Google Earth Engine to create a time series. Therefore, a smaller region must be chosen through use of the geometry tool (or a uploading a district shapefile through Google Fusion Tables), here called ‘small_region’ and shown in purple: (NOTE – Rename ‘geometry’ import to ‘small_region’)
The NDVI time series are then charted and display in the GEE Console. // Charts // //Long-Term Time Series var TS5 = ui.Chart.image.seriesByRegion(collection05, small_region, 500, 'system:time_start').setOptions({ title: 'NDVI Long-Term Time Series',
ee.Reducer.mean(),'NDVI',
7
vAxis: {title: 'NDVI'}, }); print(TS5); //Short-Term Time Series var TS1 = ui.Chart.image.seriesByRegion(collection01, small_region, 500, 'system:time_start').setOptions({ title: 'NDVI Short-Term Time Series', vAxis: {title: 'NDVI'}, }); print(TS1);
ee.Reducer.mean(),'NDVI',
The map is then centered to the desired latitude, longitude, and zoom. The short-term NDVI data is added to the map for both the clipped MODIS NDVI region and global NDVI, on a scale of 0 to 1. The color-scale is shown below. Other color codes can be found at: http://www.nthelp.com/colorcodes.htm. //Set Center of Map and Add Clipped Image Layer Map.setCenter(-50, -10, 3); //lat, long, zoom Map.addLayer (clipped00, {min: 0.0, max: 1, palette: ['FFFFFF','CC9966','CC9900', '996600', '33CC00', '009900','006600','000000']}, 'NDVI'); Map.addLayer(collection00,{min: 0.0, max: 1, palette: ['FFFFFF','CC9966','CC9900', '996600', '33CC00', '009900','006600','000000']},'NDVIglobal',false);
8
1.2 Interpretation The MODIS Normalized Difference Vegetation Index map runs on a scale of 0 to 1, where white and brown indicate no to low vegetation, and green to black indicate medium to high vegetation. It is important to note that depending on the region or range of dates selected, some information may be missing (cloud cover) and thus show up as transparent, showing the gray country layer below. The NDVI values displayed on the map are average NDVI over a short-term period (‘collection01day’). The NDVI time series charts display average NDVI over time for the user-specified geometrical “small region”.
1.3 Access The Google Earth Engine – MODIS NDVI Code can be accessed at https://code.earthengine.google.com/93cef99e109c68afdcea8a359bd27f42. Google Earth Engine access can be requested through the form at https://signup.earthengine.google.com.
1.4 Analyses Users can choose to map average NDVI over a short-term or long-term period, as desired. The user can also choose to chart long-term and short-term time series for average NDVI over any specified time periods. In addition, the user can also create NDVI anomalies. In the world of climate, the term “anomaly” means the difference between the value of a quantity and its climatological mean value. A “monthly anomaly” is the difference between the original monthly value of a quantity in a given month and the monthly climatological value for that month of the year.
Here, for months i and years j, r’ij is the monthly anomaly, rij is the original monthly value, and the remainder of the equation is the calculation of the monthly climatology (which is subtracted from the original monthly values). Monthly anomalies (of NDVI, for example) indicate the difference (positive or negative) between a monthly NDVI value and its “normal” value for that month of the year, in terms of the original units of the quantity. Calculating anomalies is one way to remove the annual cycle from a time series. This can be a useful thing to do in some types of analyses, such as the calculation of correlations between two-time series. If the annual cycle is left in the time series, a high correlation between two 9
variables may sometimes be the result of this annual cycle, which may mask other variations of greater interest to the analysis. In Google Earth Engine, the script to compute monthly anomalies for a single location, a point with Longitude -60.22 [ 60° 13’ 12” West] and Latitude -1.73 [1° 43’ 48” South], is as follow:
Imports (1 entry) var point: Point (-60.22, -1.73) var modisNDVI = ee.ImageCollection('MODIS/MCD43A4_NDVI'); var means = ee.ImageCollection(ee.List.sequence(1, 12) .map(function(m) { return modisNDVI.filter(ee.Filter.calendarRange(m, m, 'month')) .mean() .set('month', m); })); //Define time period (in this example for three years) var start = ee.Date('2012-01-01'); var months = ee.List.sequence(0, 36); var dates = months.map(function(index) { return start.advance(index, 'month'); }); print(dates); //Group by month, and then reduce within groups by mean() the result is an ImageCollection with one //image for each month. var byMonth = ee.ImageCollection.fromImages( dates.map(function(date) { var beginning = date; var end = ee.Date(date).advance(1, 'month'); var mean = modisNDVI.filterDate(beginning, end) .mean() .set('date', date); var month = ee.Date(date).getRelative('month', 'year').add(1); return mean.subtract( means.filter(ee.Filter.eq('month', month)).first()) .set('date', date);
})); print(byMonth);
//Map out results Map.addLayer(ee.Image(byMonth.first())); //Chart the Anomalies var chart = ui.Chart.image.series({ imageCollection: byMonth, region: point, reducer: ee.Reducer.mean(), scale: 10,
10
xProperty: 'date' }); print(chart);
This script is also available at: https://code.earthengine.google.com/290655fcfb538306dddaee2ec505aa2d The resulting chart shows the temperature anomalies for a single location point with coordinates: -60.22 (for Longitude 60.22 West) and -1.72 (for Latitude 1.72 South) during the time period Jan 2012 to Jan 2015.
1.5 Case Study – Brazil The Fundação Oswaldo Cruz (FIOCRUZ) in Brazil wants to assess the length and timing of the most recent severe drought event in North-East Brazil, in order to understand a possible link with mosquito population. The answer can be obtained by selecting Brazil as the target country from the Google Fusion Table ‘Country.csv’ feature collection and selecting a new polygon over the Noth East region called “north_east”. The most recent drought in Brazil occurred in January 2015, so the user could input January 2014 to December 2015 as the short-term time series and the 2002-2015 period as the long-term time series: https://code.earthengine.google.com/08b0c6db1c95415554b956f05409b8e7
11
1.6 Validation of NDVI Data The Normalized Difference Vegetation Index (NDVI) is a simple mathematical formula used to estimate the likelihood that vegetation was actively growing at a particular location whenever it was observed. NDVI was constructed in such a way that larger values correspond to higher probabilities of actually finding live green plants at the selected location and time of observation; using the reflectance in the Red channel (low reflectance values = strong chlorophyll absorption = green vegetation) and the reflectance in the Near Infra-Red channel (high reflectance values = high quantity of biomass) As the name implies, the result is a non-dimensional index or indicator of the presence of vegetation. NDVI has often been grossly abused to estimate a wide variety of environmental variables loosely connected to the presence of vegetation. 12
The user should be aware of a few problems before using the NDVI. 1) Presence of dense green vegetation implies that NDVI is high due to high concentration of chlorophyll (low reflectance in the red) and high quantity of leaves (high reflectance in the near-infrared). However, a single NDVI value (let’s say 0.5) can represent a vegetation with a lot of leaves and low quantity of chlorophyll or a vegetation with low quantity of leaves but high quantity of chlorophyll (as shown in the figure below). This is a major problem when trying to estimate biomass in different ecosystems (Olsen et al., 2015). The user should always try to use some filed measurements of the biomass and chlorophyll activity to validate the NDVI measurements. 2) In addition, sparse vegetation as it is the case in desert and semi-desert areas implies that NDVI values are lower due to less chlorophyll and leaves (see figure below)
Scatter plot of Red and Near Infra-Red (NIR) channel values showing the NDVI isolines and different types of vegetation and bare soil values. Sparse vegetation in desert areas has therefore low values of NDVI that can be confused with bare soils (bright and dark) whose spectral characteristics (in the Red and NIR bands) can result in NDVI values close to the NDVI values of sparse vegetation. It is therefore very difficult in the semi-arid and arid regions to distinguish vegetation from 13
soil using NDVI only. Methodology based on a fixed NDVI threshold value (e.g. NDVI = 0.14) to distinguish between bare soil and sparse vegetation can result in the identification of bare soils as vegetation, thereby producing an overestimation of the area covered by vegetation. This type of error is called a commission error: NDVI shows the presence of vegetation when there is no vegetation in the field (Ceccato, 2005). There are different approaches and solutions developed in the literature to improve the measurements of vegetation status. One method adopted by the UN Food Agriculture Organization Locust Group to separate vegetation from soil using NDVI is to complete the NDVI analysis by studying the reflectance in three single channels: Red, Near Infra-Red and Short Wave Infrared channels (Ceccato, 2005; Pekel et al., 2011). By combining the three channels, allocating the SWIR channel to the Red color, the NIR channel to the green color and the Red channel to the blue color, a color composite image is produced where the vegetation (due to the spectral properties) appears green in the image and the bare soil appears with a pinkish tinge (see figure below).
Location of the four SPOT-VEGETATION sensor bands, vegetation and bare soils properties. The composite color image produced can improve detection of the vegetation by eliminating the NDVI commission error as shown in the two figures below. Fig. a shows an area in Yemen where NDVI values between 0.14 and 0.16 (in yellow) and between 0.16 and 0.18 (in green) might indicate the presence of vegetation in vast areas. The composite image, however, (Fig. b) clearly indicates in green the presence of real vegetation in the river valley and the presence of 14
real bare soil (validated by field measurements) in the majority of the area detected as vegetation with NDVI.
a) NDVI values (yellow equals 0.14-0.16 and green equals 0.16-0.18) for the Hadhramaut region located in Southern Yemen. b) RGB composite (SWIR, NIR and Red) for the same region. Due to the different uncertainties related to the use of NDVI, it is always recommended to use where possible some filed measurements of the biomass and chlorophyll activity to validate the NDVI measurements or to use with caution the NDVI.
1.7 Summary The Google Earth Engine – MODIS Normalized Difference Vegetation Index (NDVI) code is to be used in assessment of historical vegetation. It enables the user to access information on any time scales between March 2000 and the present, at any location either input by country or by geometrical selection of a region.
1.8 References "MODIS: Moderate Resolution Imaging Spectroradiometer." NASA Goddard Space Flight Center. N.p., n.d. Web. 20 Apr. 2016. Ceccato, P. (2005). Operational Early Warning System Using SPOT-VGT and TERRA-MODIS to Predict Desert Locust Outbreaks. In Proceedings of the 2nd VEGETATION International Users Conference, 24-26 March 2004, Antwerpen. Editors: Veroustraete, F., Bartholome, E., Verstraeten, W.W. Luxembourg: Luxembourg: Office for Official Publication of the European Communities, ISBN 92-894-9004-7, EUR 21552 EN, 475 p Olsen, J.L., Miehe, S., Ceccato, P., Fensholt, R. (2015). Does Vegetation Parameterization from EO NDVI Data Capture Variations in Species Composition and Biomass due to Grazing in Semi-Arid Sahel? Biogeosciences12, 4407-4419. 15
Pekel, JF.,Ceccato, P., Vancutsem, C., Cressman, K., Vanbogaert, E., Defourny, P. (2011). Development and Application of Multi-Temporal Colorimetric Transformation to Monitor Vegetation in the Desert Locust Habitat. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 4:(2), 318-326
16