GEE15: Obtain time series of different remote sensing indices and the relationship between different indices

GEE

    • 1. Time series analysis between different remote sensing indices
    • 2. Relationship between different indices

1. Time series analysis between different remote sensing indices

GPP data has a significant correlation with vegetation indices (such as NDVI and EVI) to a certain extent, so what is its correlation? How to think about it from a time series perspective? Below I will use GEE code to answer this question.

Data:

  • GPP: MOD17A2H.006 Terra Gross Primary Productivity 8-Day Global 500m
  • NDVI & EVI: MOD13Q1.006 Terra Vegetation Indices 16-Day Global 250m
  • DEM: Copernicus DEM GLO-30 Global 30m Digital Elevation Model
// Time series analysis of different data sources (GPP, NDVI and EVI)
//Research area settings
var ROI = ee.FeatureCollection('projects/ee-*******736/assets/Sichuan_province')
var styling = {<!-- -->color:"red",fillColor:"00000000"}
Map.centerObject(ROI,5)
Map.addLayer(ROI.style(styling),{<!-- -->},"geometry")

//data preprocessing
//Select the data set and perform band ratio conversion
var years = ee.List.sequence(2000, 2022);
var collectYear = ee.ImageCollection(years
  .map(function(y) {<!-- -->
    var start = ee.Date.fromYMD(y, 1, 1);
    var end = start.advance(12, 'month');
    var GPP = ee.ImageCollection('MODIS/006/MOD17A2H')
                  .select('Gpp')
                  .filterDate(start, end)
                  .map(function(image){<!-- -->
                    return image.multiply(0.001).set(image.toDictionary(image.propertyNames())); // Here the GPP is expanded 10 times
                  }).mean().rename('GPP')
    var NDVI = ee.ImageCollection("MODIS/006/MOD13Q1")
                  .filterDate(start, end)
                  .select("NDVI")
                  .map(function(image){<!-- -->
                    return image.multiply(0.0001).set(image.toDictionary(image.propertyNames()))
                  }).mean().rename('NDVI');
    var EVI = ee.ImageCollection("MODIS/006/MOD13Q1")
                  .filterDate(start, end)
                  .select("EVI")
                  .map(function(image){<!-- -->
                    return image.multiply(0.0001).set(image.toDictionary(image.propertyNames()))
                  }).mean().rename('EVI');
    return GPP.addBands(NDVI).addBands(EVI).set('year',y)
}
  )
);
print(collectYear);


// Calculate the wave time series in the study area
var Yearlychart = ui.Chart.image.series({<!-- -->
  imageCollection: collectYear.select('NDVI','EVI','GPP'),
  region : ROI,
  reducer:ee.Reducer.mean(),
  scale:500,
  xProperty: 'year',})
  .setChartType('LineChart').setOptions({<!-- -->
  interpolateNulls: true,
  title: 'GPP & NDVI time series',
  hAxis: {<!-- -->title: 'Date'},
  vAxis: {<!-- -->title: 'GPP & NDVI & EVI',viewWindowMode: 'explicit'}
  });
print('GPP & NDVI & EVI time series',Yearlychart);

Results:

It can be seen that GPP has a significant correlation with the vegetation index to a certain extent, and the change trend of EVI is more similar to the change trend of GPP.

2. Relationship between different indices

In order to understand the relationship between different indices, such as linearity, I use GPP and EVI for analysis here:

// Time series analysis of different data sources (GPP, NDVI and EVI)
//Research area settings
var ROI = ee.FeatureCollection('projects/ee-******736/assets/Sichuan_province')
var styling = {<!-- -->color:"red",fillColor:"00000000"}
Map.centerObject(ROI,5)
Map.addLayer(ROI.style(styling),{<!-- -->},"geometry")

//Data selection Gpp and EVI (the time series of EVI and Gpp are more consistent)
var start = ee.Date.fromYMD(2022, 3, 1);
var end = start.advance(6, 'month'); //Select the growing season
var GPP = ee.ImageCollection('MODIS/006/MOD17A2H') // The spatial resolution is 500m
                  .select('Gpp')
                  .filterDate(start, end)
                  .map(function(image){<!-- -->
                    return image.multiply(0.0005).set(image.toDictionary(image.propertyNames()));
//The GPP is expanded 5 times here
                  }).mean().rename('GPP')
                  .clip(ROI);
var EVI = ee.ImageCollection("MODIS/006/MOD13Q1") // The spatial resolution is 250m
                  .filterDate(start, end)
                  .select("EVI")
                  .map(function(image){<!-- -->
                    return image.multiply(0.0001).set(image.toDictionary(image.propertyNames()));
                  }).mean().reproject('EPSG:4326',null,500)
                  .clip(ROI);
\t\t\t\t  


// To create two arrays, EVI and Gpp, you need to keep the spatial resolution of the two data consistent, 500m is sufficient.
var merge = EVI.addBands(GPP).clip(ROI);
var array = merge.reduceRegion({<!-- -->reducer: ee.Reducer.toList(), geometry: ROI, scale: 1000});
var x = ee.List(array.get('GPP')).slice(0, 5000);//Note: The slice range here cannot exceed the range of the data vector itself, otherwise an error will be reported
var y = ee.List(array.get('EVI')).slice(0, 5000);


// data visualization
var chart = ui.Chart.array.values({<!-- -->array: y, axis: 0, xLabels: x}).setOptions({<!-- -->
  title: 'Relationship between the EVI and GPP',
  colors: ['green'],
  hAxis: {<!-- -->
    title: 'GPP(kg*C/m^2)',
    titleTextStyle: {<!-- -->italic: false, bold: true},
    viewWindow: {<!-- -->min: 0, max: 0.3}
  },
  vAxis: {<!-- -->
    title: 'EVI values',
    titleTextStyle: {<!-- -->italic: false, bold: true},
    viewWindow: {<!-- -->min: -0.1, max: 0.7}
  },
  pointSize: 2, //Adjust the size of the point
  legend: {<!-- -->position: 'none'},
});

print('Relationship between the EVI and GPP',chart);

Result:

It can be seen that there is a certain linear correlation between GPP and EVI.

The changing relationship between EVI and terrain (elevation):

//Research area settings
var ROI = ee.FeatureCollection('projects/ee-yipeizhao736/assets/Sichuan_province')
var styling = {<!-- -->color:"red",fillColor:"00000000"}
Map.centerObject(ROI,5)
Map.addLayer(ROI.style(styling),{<!-- -->},"geometry")

//Data selection DEM and EVI
var start = ee.Date.fromYMD(2022, 3, 1);
var end = start.advance(6, 'month'); //Select the growing season
var DEM = ee.ImageCollection('COPERNICUS/DEM/GLO30') // The spatial resolution is 30m
                  .select('DEM')
                  .map(function(image){<!-- -->
                    return image.set(image.toDictionary(image.propertyNames()));
                  }).mean().rename('DEM')
                  .clip(ROI);
var EVI = ee.ImageCollection("MODIS/006/MOD13Q1") // The spatial resolution is 250m
                  .filterDate(start, end)
                  .select("EVI")
                  .map(function(image){<!-- -->
                    return image.multiply(0.0001).set(image.toDictionary(image.propertyNames()));
                  }).mean().rename('EVI')
                  .clip(ROI);
\t\t\t\t  


var merge = EVI.addBands(DEM).clip(ROI);
var array = merge.reduceRegion({<!-- -->reducer: ee.Reducer.toList(), geometry: ROI, scale: 250}); //
var x = ee.List(array.get('DEM')).slice(0, 5000);
var y = ee.List(array.get('EVI')).slice(0, 5000);


// data visualization
var DEM_EVIChart = ui.Chart.array.values({<!-- -->array: y, axis: 0, xLabels: x}).setOptions({<!-- -->
  title: 'Relationship between the EVI and DEM',
  colors: ['green'],
  hAxis: {<!-- -->
    title: 'DEM(m)',
    titleTextStyle: {<!-- -->italic: false, bold: true},
    viewWindow: {<!-- -->min: 2000, max: 5500}
  },
  vAxis: {<!-- -->
    title: 'EVI values',
    titleTextStyle: {<!-- -->italic: false, bold: true},
    viewWindow: {<!-- -->min: -0.1, max: 0.9}
  },
  pointSize: 2, //Adjust the size of the point
  legend: {<!-- -->position: 'none'},
});
print('Relationship between the EVI and DEM', DEM_EVIChart);

Results:

Modify the data set and consider the relationship between NDVI and altitude. The results are as follows:

It can be seen that as the altitude rises, there are complex and uneven changes in the vegetation. It is worth noting that the vegetation distribution between 3250 and 3500 is relatively concentrated and contains various types or densities of vegetation; the vegetation distribution peak Located between 3500 ~ 4000m altitude;Through this method, we can understand the changes in vegetation richness with altitude.