Google Earth Engine (GEE)——利用两种方式进行EVI指数(含函数的两种定义方式)

如何快速使用波段进行指数的计算,我们这里利用两种方式进行EVI指数计算,一种是利用expression的方式进行分析,虽然两种方法的结算结果都一样,但是代码有多有少,大家可以参考使用,但是两者的作用对象都是影像集合,对影像集合映射前我们需要建立函数,然后用map进行映射。本次教程中我们在返回值的过程中进行了不同处理,一个是将EVI作为一个波段添加到应先该集合中,另外一种方式是直接返回给所计算出来的EVI波段。最后我们可以通过count函数统计影像集合中的波段数量。

同时,我们也可以注意两种函数的定义方式,一种是直接定义函数,另一种是按照变量名来定义,只是有一个简单的变化,大家可以根据代码自己对比分析。方法二适合初学者,更便于理解函数的公式整个运行过程,方法一适合大部分人,因为更加简单和方便。

这里用到的公式:

expression(expression, map)

Evaluates an arithmetic expression on an image, possibly involving additional images.

The bands of the primary input image are available using the built-in function b(), as b(0) or b('band_name').

Variables in the expression are interpreted as additional image parameters which must be supplied in opt_map. The bands of each such image can be accessed like i

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/128557047