Google Earth Engine(GEE)——如何进行NDVI和EVI指数的图表展示?

简介: Google Earth Engine(GEE)——如何进行NDVI和EVI指数的图表展示?

我们如何进行NDVI和EVI指数的图表展示,我们可以通过建立一个函数NDVI和EVI,然后用map遍历每一期影像,从而实现图表的展示,这我们使用sentinel2影像进行分析。

Sentinel-2卫星是由欧洲空间局(ESA)和欧洲联盟开发的一个卫星系统,它可以提供高分辨率和高质量的地球观测数据,特别是在多光谱图像方面。

以下是Sentinel-2卫星影像的相关信息:

  1. 分辨率:Sentinel-2卫星有两个多光谱传感器(MSI),分别具有10米、20米和60米的分辨率。其中,10米分辨率的传感器可以提供高精度的地表信息。
  2. 波段:Sentinel-2卫星的多光谱传感器可以捕捉13个波段的数据,包括红外和紫外波段。
  3. 数据提供方式:Sentinel-2卫星的数据由ESA提供,并且可以通过ESA的Sentinel数据门户进行访问和下载。此外,一些商业公司也提供了Sentinel-2卫星数据的订阅和使用服务。
  4. 应用领域:Sentinel-2卫星影像在许多领域都有广泛的应用,包括农业、林业、城市规划、自然资源管理和环境监测等。

 

函数:

setOptions(options)

Sets options used to style this chart.

Returns this chart.

Arguments:

this:ui.chart (ui.Chart):

The ui.Chart instance.

options (Object):

An object defining chart style options such as:

Returns: ui.Chart

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)

Generates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.

  • X-axis: Image, labeled by xProperty value.
  • Y-axis: Band value.
  • Series: Band names.

Returns a chart.

Arguments:

imageCollection (ImageCollection):

An ImageCollection with data to be included in the chart.

region (Feature|FeatureCollection|Geometry):

The region to reduce.

reducer (Reducer, optional):

Reducer that generates the values for the y-axis. Must return a single value. Defaults to ee.Reducer.mean().

scale (Number, optional):

Scale to use with the reducer in meters.

xProperty (String, optional):

Property to be used as the label for each image on the x-axis. Defaults to 'system:time_start'.

Returns: ui.Chart

代码:

var geometry = 
    /* color: #d63000 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[113.12962886187917, -8.101032847560129],
          [113.12962886187917, -8.12754392211754],
          [113.16533442828542, -8.12754392211754],
          [113.16533442828542, -8.101032847560129]]], null, false);
var S2A = ee.ImageCollection('COPERNICUS/S2_SR').filterDate('2021-01-01','2022-01-01').filterBounds(geometry);
// print(S2A);
var getIndices=function(image){
  var NDVI = image.normalizedDifference(['B8', 'B4']).rename('NDVI');
  var EVI = image.expression('2.5 * ((NIR - RED) / (NIR + 2.4 * RED + 1))', 
  {
    'NIR': image.select('B8'),
    'RED': image.select('B4')
  }).rename('EVI');
  return image.addBands([NDVI,EVI]);
};
var collection=S2A.map(getIndices);
// print(collection);
var chartEVI = ui.Chart.image.series({
  imageCollection: collection.select('EVI'),
  region: geometry,
  reducer: ee.Reducer.mean(),
  scale: 20
}).setOptions({
      title: 'Original EVI Time Series',
      interpolateNulls: false,
      vAxis: {title: 'EVI', viewWindow: {min: 0, max: 1}},
      hAxis: {title: '', format: 'YYYY-MM'},
      lineWidth: 1,
      pointSize: 4,
      series: {
        0: {color: '#238b45'},
      },
    })
print(chartEVI);
var chartNDVI = ui.Chart.image.series({
  imageCollection: collection.select('NDVI'),
  region: geometry,
  reducer: ee.Reducer.mean(),
  scale: 20
}).setOptions({
      title: 'Original EVI Time Series',
      interpolateNulls: false,
      vAxis: {title: 'EVI', viewWindow: {min: 0, max: 1}},
      hAxis: {title: '', format: 'YYYY-MM'},
      lineWidth: 1,
      pointSize: 4,
      series: {
        0: {color: '#238b45'},
      },
    })
print(chartNDVI);
相关文章
|
5月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
2271 1
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
5月前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
211 0
|
5月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
509 1
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
5月前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
81 0
|
5月前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
122 0
|
5月前
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
71 0
|
5月前
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
241 0
|
5月前
|
传感器 编解码 数据处理
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
104 0
|
5月前
Google Earth Engine(GEE)——当加载图表的时候出现错误No features contain non-null values of “system:time_start“.
Google Earth Engine(GEE)——当加载图表的时候出现错误No features contain non-null values of “system:time_start“.
116 0
|
5月前
|
编解码 定位技术
Google Earth Engine(GEE)——导出后的影像像素不同于原始Landsat影像的分辨率(投影差异)
Google Earth Engine(GEE)——导出后的影像像素不同于原始Landsat影像的分辨率(投影差异)
138 0