zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Google Earth Engine(GEE)——利用python进行时序LandTrendr分析

PythonGoogle 分析 利用 进行 Engine Earth GEE
2023-09-11 14:15:11 时间

本次教程主要是利用python进行LandTrendr时序分析,产看影像的变化,颜色的变化显示变化的程度,为变化的影像为灰色的影像。

代码:

from google.colab import auth
auth.authenticate_user()

import google
SCOPES = ['https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/earthengine']
CREDENTIALS, project_id = google.auth.default(default_scopes=SCOPES)

import ee
ee.Initialize(CREDENTIALS, project='my-project (edit this string)')

import folium
import pprint


# 按年份和月份过滤的MODIS集合,选择非QA波段。
col = (ee.ImageCollection('MODIS/061/MOD13Q1')
  .filterDate('2000', '2021')
  .filter(ee.Filter.calendarRange(7, 8, 'month'))
  .select('NDVI|EVI|sur_refl.*'))

# 为集合中的所有图像添加年份属性。
col = col.map(lambda img: img.set('year', img.date().get('year')))

# 将同一年的所有图像加入到列表中。
distinctCol = col.distinct(['year'])
joinFilter = ee.Filter.equals(**{&